Add Reconnect button to embedded disconnect overlay and restore VM service connection after sleep/wake#9693
Open
rishika0212 wants to merge 9 commits intoflutter:masterfrom
Open
Conversation
elliette
requested changes
Mar 19, 2026
Member
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
Contributor
Author
|
Pushed updates addressing all the comments. Thanks for the helpful feedback. |
elliette
reviewed
Mar 20, 2026
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
requested changes
Mar 31, 2026
Member
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
requested changes
Apr 2, 2026
Member
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
elliette
approved these changes
Apr 6, 2026
|
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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
///).