[CP-stable][ Tool ] Handle DartDevelopmentServiceException when launching web applications#180924
Conversation
…applications (flutter#180905) DWDS can throw `DartDvelopmentServiceException` if DDS fails to connect to DWDS due to the target application shutting down immediately after launch. This change adds logic to catch this exception and exit gracefully. Fixes flutter#178151 --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
@bkonyi please fill out the PR description above, afterwards the release team will review this request. |
|
This pull request was opened from and to a release candidate branch. This should only be done as part of the official Flutter release process. If you are attempting to make a regular contribution to the Flutter project, please close this PR and follow the instructions at Tree Hygiene for detailed instructions on contributing to Flutter. Reviewers: Use caution before merging pull requests to release branches. Ensure the proper procedure has been followed. |
There was a problem hiding this comment.
Code Review
This pull request introduces improved error handling for web applications when the Dart Development Service (DDS) encounters a DartDevelopmentServiceException during startup. Specifically, it addresses cases where the application might shut down before DDS can fully establish its connection, preventing unhandled exceptions and ensuring a graceful exit. A new test case has been added to validate this specific error handling scenario.
There was a problem hiding this comment.
Approving to be included in the next stable hotfix.
FYI @reidbaker
a6d741b
into
flutter:flutter-3.38-candidate.0
…when launching web applications (flutter/flutter#180924)
This pull request is created by automatic cherry pick workflow
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.
Issue Link:
What is the link to the issue this cherry-pick is addressing?
#178151
Changelog Description:
Explain this cherry pick in one line that is accessible to most Flutter developers. See best practices for examples
flutter run -d chromecan crash with aDartDevelopmentServiceExceptionif the application shuts down during the startup sequence.Impact Description:
What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping production app (the app crashes on launch)
Flaky crashes for users developing Flutter web applications. This is one of the top crashers for 3.38.
Workaround:
Is there a workaround for this issue?
N/A
Risk:
What is the risk level of this cherry-pick?
Test Coverage:
Are you confident that your fix is well-tested by automated tests?
Validation Steps:
What are the steps to validate that this fix works?
Difficult to validate manually as the failure is timing based. Tests have been added to simulate the crash scenario and verify the fix.