Commit 661dafd
authored
Defer execution of main until resume for hot restart with DDC library bundle format (#2623)
pause_isolates_on_start tells DWDS and the client that during a
hot restart or a hot reload, the VM service will pause and is
actively waiting for the client to remove existing breakpoints,
reregister them, and then resume. It lets the client know by
sending a kPausePostRequest event.
In order to do this in DWDS, we need to defer the execution of
main until that resume. So, like we do with the require
restarter, we wait for a completer to finish before we call
main after a hot restart. This completer is only provided when
the flag is enabled.
Fixes existing code that marks the completer as completed before
running main. The previous code canceled the subscription in an
unawaited Future. This may result in us recalling main because
the event stream could still have a listener. An example is if
we hit a breakpoint immediately after main and call resume.
Also fixes an issue where metadata information isn't recomputed
on a hot restart. This is needed when new files are added.
Fixes some hot restart tests that should wait for main to execute.
Adds tests for:
- Modifying a line with a breakpoint and restarting.
- Adding a line before a breakpoint and restarting.
- Removing a line before a breakpoint and restarting.
- Adding a file and putting a breakpoint in it before restarting.1 parent 01a3b9d commit 661dafd
File tree
14 files changed
+936
-557
lines changed- dwds
- lib/src
- handlers
- injected
- services
- test
- common
- fixtures
- web/reloader
- fixtures
- _testHotRestartBreakpoints
- web
- _testSound/example/append_body
14 files changed
+936
-557
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
443 | 442 | | |
444 | 443 | | |
445 | 444 | | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
| 445 | + | |
| 446 | + | |
450 | 447 | | |
| 448 | + | |
451 | 449 | | |
452 | 450 | | |
453 | 451 | | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | 452 | | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | 453 | | |
465 | 454 | | |
466 | 455 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
538 | 538 | | |
539 | 539 | | |
540 | 540 | | |
541 | | - | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
542 | 544 | | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | 545 | | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | 546 | | |
554 | 547 | | |
555 | 548 | | |
| |||
0 commit comments