From b225113452d1c3e35a98151d11784b68fcbbb796 Mon Sep 17 00:00:00 2001 From: Elliott Brooks <21270878+elliette@users.noreply.github.com> Date: Wed, 29 May 2024 11:10:46 -0700 Subject: [PATCH 1/2] Send kPausePostEvent after restarting --- dwds/lib/src/services/chrome_proxy_service.dart | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dwds/lib/src/services/chrome_proxy_service.dart b/dwds/lib/src/services/chrome_proxy_service.dart index 7b552bc93..887e5e46b 100644 --- a/dwds/lib/src/services/chrome_proxy_service.dart +++ b/dwds/lib/src/services/chrome_proxy_service.dart @@ -99,6 +99,9 @@ class ChromeProxyService implements VmServiceInterface { /// This value can be updated at runtime via [setFlag]. bool get pauseIsolatesOnStart => _pauseIsolatesOnStart; + /// Whether or not the connected app has a pending restart. + bool get hasPendingRestart => _resumeAfterRestartEventsController.hasListener; + final _resumeAfterRestartEventsController = StreamController.broadcast(); @@ -353,6 +356,20 @@ class ChromeProxyService implements VmServiceInterface { ); } + // If the new isolate was created as part of a restart, send a + // kPausePostRequest event to notify client that the app is paused so that + // it can resume: + if (hasPendingRestart) { + _streamNotify( + 'Debug', + Event( + kind: EventKind.kPausePostRequest, + timestamp: timestamp, + isolate: isolateRef, + ), + ); + } + // The service is considered initialized when the first isolate is created. if (!_initializedCompleter.isCompleted) _initializedCompleter.complete(); } From 6e56526a3a2b8ab0901f2280b968096e87cdb70b Mon Sep 17 00:00:00 2001 From: Elliott Brooks <21270878+elliette@users.noreply.github.com> Date: Wed, 29 May 2024 11:15:22 -0700 Subject: [PATCH 2/2] Update CHANGELOG --- dwds/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/dwds/CHANGELOG.md b/dwds/CHANGELOG.md index 05b66af7f..7dee0ec8a 100644 --- a/dwds/CHANGELOG.md +++ b/dwds/CHANGELOG.md @@ -2,6 +2,7 @@ - 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) - Respect the value of `pause_isolates_on_start` during page-refreshes. - [#2431](https://github.com/dart-lang/webdev/pull/2431) +- Fix issue where DAP clients wouldn't resume after a restart. - [#2441](https://github.com/dart-lang/webdev/pull/2441) ## 24.0.0