Add Reconnect button to embedded disconnect overlay and restore VM service connection after sleep/wake#9693
Conversation
elliette
left a comment
There was a problem hiding this comment.
Thank you for the PR! Please address the comments and I will take another look.
packages/devtools_app/lib/src/framework/observer/disconnect_observer.dart
Outdated
Show resolved
Hide resolved
packages/devtools_app/lib/src/framework/observer/disconnect_observer.dart
Outdated
Show resolved
Hide resolved
packages/devtools_app/lib/src/framework/observer/disconnect_observer.dart
Outdated
Show resolved
Hide resolved
packages/devtools_app/lib/src/framework/observer/disconnect_observer.dart
Outdated
Show resolved
Hide resolved
packages/devtools_app/lib/src/framework/observer/disconnect_observer.dart
Outdated
Show resolved
Hide resolved
packages/devtools_app/lib/src/standalone_ui/ide_shared/not_connected_overlay.dart
Outdated
Show resolved
Hide resolved
packages/devtools_app/test/framework/observer/disconnect_observer_test.dart
Show resolved
Hide resolved
|
Pushed updates addressing all the comments. Thanks for the helpful feedback. |
packages/devtools_app/lib/src/framework/observer/disconnect_observer.dart
Outdated
Show resolved
Hide resolved
packages/devtools_app/lib/src/framework/observer/disconnect_observer.dart
Show resolved
Hide resolved
elliette
left a comment
There was a problem hiding this comment.
A few more changes but LGTM! Thank you
packages/devtools_app/lib/src/framework/observer/disconnect_observer.dart
Outdated
Show resolved
Hide resolved
packages/devtools_app/lib/src/framework/observer/disconnect_observer.dart
Outdated
Show resolved
Hide resolved
packages/devtools_app/lib/src/framework/observer/disconnect_observer.dart
Outdated
Show resolved
Hide resolved
…stenableBuilder and safeUnawaited
elliette
left a comment
There was a problem hiding this comment.
One small change but otherwise LGTM!
packages/devtools_app/lib/src/framework/observer/disconnect_observer.dart
Show resolved
Hide resolved
|
autosubmit label was removed for flutter/devtools/9693, because This PR has not met approval requirements for merging. The PR author is not a member of flutter-hackers and needs 1 more review(s) in order to merge this PR.
|
elliette
left a comment
There was a problem hiding this comment.
Please run dt fix-goldens --run-id=24064811951 and upload the golden changes introduced by this change. This should help us determine whether the changes are expected or regressions. Thanks!
Fixes #9683
This PR adds a Reconnect button to the embedded DevTools disconnect overlay and fixes reconnect behavior after a machine sleep/wake cycle.
Previously, when the system went to sleep during a Flutter debug session, DevTools lost its connection to the VM service and displayed:
"Disconnected — Run a new debug session to reconnect."
In embedded/IDE mode this message provided no actionable way to reconnect, forcing users to restart their entire debug session.
Standalone DevTools already included a Reconnect button, but the reconnect flow only attempted to restore the DTD connection and did not re-establish the VM service connection, causing reconnect attempts to silently fail.
This PR improves the reconnect behavior by:
Using routerDelegate.navigate() previously routed through _replaceStack → manuallyDisconnect().
If reconnect failed, manuallyDisconnect() set userInitiatedConnectionState = true, which caused the disconnect overlay to be permanently suppressed. Users were then unable to retry reconnecting without restarting the debug session.
With this change, reconnect attempts directly restore the VM service connection, allowing DevTools to recover without restarting the debug session.
Testing
Automated tests
Updated disconnect_observer_test.dart:
Manual testing
The following scenario was tested:
Result:
DevTools reconnects to the VM service
The debug session continues without needing to restart the app
Release Notes
A note has been added to:
packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md
Pre-launch Checklist:
///).