Skip to content

[CP-stable][ Tool ] Handle DartDevelopmentServiceException when launching web applications#180924

Merged
auto-submit[bot] merged 1 commit intoflutter:flutter-3.38-candidate.0from
flutteractionsbot:cp-stable-d47b49915719f9ed338c638cc149f69ab5a531a4
Jan 14, 2026
Merged

[CP-stable][ Tool ] Handle DartDevelopmentServiceException when launching web applications#180924
auto-submit[bot] merged 1 commit intoflutter:flutter-3.38-candidate.0from
flutteractionsbot:cp-stable-d47b49915719f9ed338c638cc149f69ab5a531a4

Conversation

@flutteractionsbot
Copy link

@flutteractionsbot flutteractionsbot commented Jan 13, 2026

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 chrome can crash with a DartDevelopmentServiceException if 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?

  • Low
  • Medium
  • High

Test Coverage:

Are you confident that your fix is well-tested by automated tests?

  • Yes
  • No

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.

…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>
@flutteractionsbot flutteractionsbot added the cp: review Cherry-picks in the review queue label Jan 13, 2026
@flutteractionsbot
Copy link
Author

@bkonyi please fill out the PR description above, afterwards the release team will review this request.

@flutter-dashboard
Copy link

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.

@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jan 13, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@walley892 walley892 self-requested a review January 14, 2026 22:33
Copy link
Contributor

@walley892 walley892 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving to be included in the next stable hotfix.

FYI @reidbaker

@walley892 walley892 added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 14, 2026
@auto-submit auto-submit bot merged commit a6d741b into flutter:flutter-3.38-candidate.0 Jan 14, 2026
140 checks passed
This was referenced Jan 23, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App cp: review Cherry-picks in the review queue tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants