Add Reconnect button to embedded disconnect overlay and restore VM service connection after sleep/wake#9693
Add Reconnect button to embedded disconnect overlay and restore VM service connection after sleep/wake#9693rishika0212 wants to merge 12 commits intoflutter:masterfrom
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.
|
Pushed updates addressing all the comments. Thanks for the helpful feedback. |
elliette
left a comment
There was a problem hiding this comment.
A few more changes but LGTM! Thank you
…stenableBuilder and safeUnawaited
elliette
left a comment
There was a problem hiding this comment.
One small change but otherwise LGTM!
|
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!
Done, ran |
|
Thanks for the updates! Please resync with the master branch to resolve the merge conflicts |
e3cd3c1 to
f004e45
Compare
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:
///).