Skip to content

Conversation

@bkonyi
Copy link
Contributor

@bkonyi bkonyi commented Dec 19, 2025

DTD only supports a single instance of a registered service with a given name. For widget preview development, we sometimes want to use a DTD instance that's attached to an IDE to test IDE integration. However, IDEs frequently spawn their own widget preview instances which register services with DTD. In the case where flutter widget-preview start --dtd-url=<dtd-url> is run and dtd-url points to a DTD instance with another widget preview service running, the process simply crashes.

This change adds a unique identifier to the widget preview DTD service and stream names that allows for each flutter widget-preview start instance to register its own unique widget preview DTD services, even if other widget preview instances are using the same DTD instance.

Fixes #179883

DTD only supports a single instance of a registered service with a given
name. For widget preview development, we sometimes want to use a DTD
instance that's attached to an IDE to test IDE integration. However,
IDEs frequently spawn their own widget preview instances which register
services with DTD. In the case where `flutter widget-preview start
--dtd-url=<dtd-url>` is run and `dtd-url` points to a DTD instance with
another widget preview service running, the process simply crashes.

This change adds a unique identifier to the widget preview DTD service
and stream names that allows for each `flutter widget-preview start`
instance to register its own unique widget preview DTD services, even if
other widget preview instances are using the same DTD instance.

Fixes flutter#179883
@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Dec 19, 2025
@bkonyi bkonyi requested review from DanTup and jyameo and removed request for DanTup December 19, 2025 20:44
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 addresses an issue where multiple widget preview instances could not connect to the same DTD instance by introducing unique identifiers (UUIDs) for DTD service and stream names. The changes are well-implemented, including a new flag to disable this behavior for testing purposes. I have one suggestion regarding code organization to improve maintainability.

Copy link
Contributor

@jyameo jyameo left a comment

Choose a reason for hiding this comment

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

lgtm!

@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 20, 2025
@auto-submit
Copy link
Contributor

auto-submit bot commented Dec 20, 2025

autosubmit label was removed for flutter/flutter/180140, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Dec 20, 2025
Copy link
Contributor

@DanTup DanTup left a comment

Choose a reason for hiding this comment

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

lgtm!

I am assuming that:

  1. The IDEs aren't expect to make any changes here
  2. The UUIDs don't affect anything outside of the widget preview (because these are just its own internal services), so the uuids being enabled by default even by the version spawned by the editor will not affect anyone

@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 5, 2026
@auto-submit auto-submit bot added this pull request to the merge queue Jan 5, 2026
Merged via the queue into flutter:master with commit afb13d8 Jan 5, 2026
143 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jan 5, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 6, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 6, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 6, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 6, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 6, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 6, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 7, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 7, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 7, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 7, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[tool_crash] RpcException trying to start a widget preview using a DTD connection that already has a widget preview

3 participants