-
Notifications
You must be signed in to change notification settings - Fork 29.8k
[ Widget Preview ] Add UUID to registered DTD streams and services #180140
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
[ Widget Preview ] Add UUID to registered DTD streams and services #180140
Conversation
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
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.
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.
packages/flutter_tools/lib/src/widget_preview/dtd_services.dart
Outdated
Show resolved
Hide resolved
jyameo
left a comment
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.
lgtm!
|
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. |
DanTup
left a comment
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.
lgtm!
I am assuming that:
- The IDEs aren't expect to make any changes here
- 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
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 anddtd-urlpoints 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 startinstance to register its own unique widget preview DTD services, even if other widget preview instances are using the same DTD instance.Fixes #179883