Skip to content

Commit 7eeebbb

Browse files
authored
Send a kPausePostRequest after restarting to notify clients to resume (#2441)
1 parent 1bed26a commit 7eeebbb

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Diff for: dwds/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
- Fix bug where debugging clients are not aware of service extensions when connecting to a new web app. - [#2388](https://github.com/dart-lang/webdev/pull/2388)
44
- Respect the value of `pause_isolates_on_start` during page-refreshes. - [#2431](https://github.com/dart-lang/webdev/pull/2431)
5+
- Fix issue where DAP clients wouldn't resume after a restart. - [#2441](https://github.com/dart-lang/webdev/pull/2441)
56

67
## 24.0.0
78

Diff for: dwds/lib/src/services/chrome_proxy_service.dart

+17
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ class ChromeProxyService implements VmServiceInterface {
9999
/// This value can be updated at runtime via [setFlag].
100100
bool get pauseIsolatesOnStart => _pauseIsolatesOnStart;
101101

102+
/// Whether or not the connected app has a pending restart.
103+
bool get hasPendingRestart => _resumeAfterRestartEventsController.hasListener;
104+
102105
final _resumeAfterRestartEventsController =
103106
StreamController<String>.broadcast();
104107

@@ -353,6 +356,20 @@ class ChromeProxyService implements VmServiceInterface {
353356
);
354357
}
355358

359+
// If the new isolate was created as part of a restart, send a
360+
// kPausePostRequest event to notify client that the app is paused so that
361+
// it can resume:
362+
if (hasPendingRestart) {
363+
_streamNotify(
364+
'Debug',
365+
Event(
366+
kind: EventKind.kPausePostRequest,
367+
timestamp: timestamp,
368+
isolate: isolateRef,
369+
),
370+
);
371+
}
372+
356373
// The service is considered initialized when the first isolate is created.
357374
if (!_initializedCompleter.isCompleted) _initializedCompleter.complete();
358375
}

0 commit comments

Comments
 (0)