Repository navigation
[dap] Don't wait for appStarted before responding to launch/attach + don't call app.stop for unstarted app - #109386
Conversation
+ don't call app.stop for an app that never started.
|
Working on the test failures, and a little bit more cleanup, so changing this back to Draft.. Edit: Apparently I can't.. I'll ping when it's ready again. |
+ ensure it's only ever called from one place.
|
@christopherfujino ok, it's good now. There was a method |
| _appId = params['appId'] as String?; | ||
| assert(_appId != null); | ||
| appId = params['appId'] as String?; | ||
| assert(appId != null); |
There was a problem hiding this comment.
should we throw a StateError in this case?
There was a problem hiding this comment.
Yeah, throwing makes sense. Although I used DebugAdapterException instead of StateError since it's not really related to the state of this object, if we get a null here it means flutter run --machine has emitted an invalid app.start event (without a valid appId).
christopherfujino
left a comment
There was a problem hiding this comment.
LGTM with one question about crashing rather than asserting
|
You are having windows build_tests failing can we address those? |
|
@christopherfujino do you know what's wrong with that build? I'm not sure if I'm looking at the right part of the log, but I see some failures like this: If I'm understanding the log correctly, this might be a test unrelated to this PR: |
I've been out of office for a week and a half, so I don't recognize this, however I'm 99% sure it's unrelated to this PR. I'd try rebasing upstream. |
|
Looks that fixed it, thanks! |
…ttach + don't call app.stop for unstarted app (flutter/flutter#109386)
…ttach + don't call app.stop for unstarted app (flutter/flutter#109386)
…ttach + don't call app.stop for unstarted app (flutter/flutter#109386)
…ttach + don't call app.stop for unstarted app (flutter/flutter#109386)
…ttach + don't call app.stop for unstarted app (flutter/flutter#109386)
…ttach + don't call app.stop for unstarted app (flutter/flutter#109386)
…ttach + don't call app.stop for unstarted app (flutter/flutter#109386)
…ttach + don't call app.stop for unstarted app (flutter/flutter#109386)
…ttach + don't call app.stop for unstarted app (flutter/flutter#109386)
…ttach + don't call app.stop for unstarted app (flutter/flutter#109386)
…ttach + don't call app.stop for unstarted app (flutter/flutter#109386)
…ttach + don't call app.stop for unstarted app (flutter/flutter#109386)
…ttach + don't call app.stop for unstarted app (flutter/flutter#109386)
…ttach + don't call app.stop for unstarted app (flutter/flutter#109386)
…ttach + don't call app.stop for unstarted app (flutter/flutter#109386)
This removes some code that would wait for the
app.startedevent before responding to the DAP'slaunch(orattach) requests. VS Code waits for the response to this event before performing some actions (such as showing the Debug Console) and the legacy DAPs never waited for this (I think I did this originally to simplify some tests knowing when the debugger was initialised, but since there are side-effects it's not the right way).It also prevents us trying to send an
app.stopevent if an app never really started (we would sendnullas anappIdto Flutter which would generate an error).Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.