-
Notifications
You must be signed in to change notification settings - Fork 83
[MV3 Debug Extension] Handle unexpected extension debugger disconnection events without crashing app #2021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
} | ||
} | ||
|
||
/// Starts a [DebugService] for Dart Debug Extension. | ||
Future<void> _startExtensionDebugService() async { | ||
Future<void> _startExtensionDebugService( | ||
ExtensionDebugger extensionDebugger) async { | ||
final extensionDebugger = await _extensionBackend!.extensionDebugger; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use the extensionDebugger passed to the function instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops yes! That was the whole point of passing in the param...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if hot restart work well with the extension (ie not closing the debugger).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LTGM with one ask (could be a separate PR) - can we add tests for hot restart with the extension if we don't have any?
Sure! Opened #2023 to track |
Fixes b/271611587
Before this PR, you could cause an app to crash by:
Depending on the timing, it might crash with an error thrown by DDS:
Or with an error thrown by package:sse:
This handles both cases by catching those errors, logging what went wrong, and closing the extension debugger.