Skip to content
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

Only one service method registered at a time #5960

Merged
merged 2 commits into from
Jun 27, 2023

Conversation

elliette
Copy link
Member

Fixes #5958

Whenever we got a new service extension method for a service extension we had already registered, we would append it to the end of the list (even though we only would ever use the first method in the list).

That meant if we switched platforms / apps (eg, connected devtools to a macos device, then connected it to a chrome device), we would still use the extension methods that were registered for the first app. If the method name had changed, then those calls would fail.

@elliette elliette requested a review from a team as a code owner June 26, 2023 22:50
@elliette elliette requested review from CoderDake and removed request for a team June 26, 2023 22:50
_registeredMethodsForService;
final Map<String, List<String>> _registeredMethodsForService = {};
final Map<String, String> _registeredMethodsForService = {};
Copy link
Member

Choose a reason for hiding this comment

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

should we empty this map in vmServiceClosed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Service extension methods should be cleared between app connections
2 participants