-
Notifications
You must be signed in to change notification settings - Fork 326
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
allow DevTools to re-connect to a new app after closing a previous app #1898
Conversation
final serviceAvailable = Completer<void>(); | ||
Completer<VmService> _serviceAvailable = Completer(); | ||
|
||
Future get onServiceAvailable => _serviceAvailable.future; |
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.
missing type.
Future
--> Future<VmService>
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.
updated
@@ -138,7 +142,7 @@ class ServiceConnectionManager { | |||
serviceTrafficLogger = VmServiceTrafficLogger(service); | |||
} | |||
|
|||
serviceAvailable.complete(); | |||
_serviceAvailable.complete(service); |
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.
we might want to also add
if (_serviceAvaillabe.isCompleted) {_serviceAvailable = Completer();}
at the start of this method to further support opening a new service when there was an existing service. Maybe just add a TODO because we would really want to further guard things so only one request to switch to a new vm service could be triggered at once.
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.
If we're actively connected to a we likely want to guard against opening a new connection - I expect we'll first want to disconnect from the existing connection?
I'll add a TODO:, and open an issue about having a way to disconnect from the current connection in the UI.
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.
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.
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.
Comments addressed, though I need to fix some tests before landing this.
final serviceAvailable = Completer<void>(); | ||
Completer<VmService> _serviceAvailable = Completer(); | ||
|
||
Future get onServiceAvailable => _serviceAvailable.future; |
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.
updated
@@ -138,7 +142,7 @@ class ServiceConnectionManager { | |||
serviceTrafficLogger = VmServiceTrafficLogger(service); | |||
} | |||
|
|||
serviceAvailable.complete(); | |||
_serviceAvailable.complete(service); |
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.
If we're actively connected to a we likely want to guard against opening a new connection - I expect we'll first want to disconnect from the existing connection?
I'll add a TODO:, and open an issue about having a way to disconnect from the current connection in the UI.
@@ -138,7 +142,7 @@ class ServiceConnectionManager { | |||
serviceTrafficLogger = VmServiceTrafficLogger(service); | |||
} | |||
|
|||
serviceAvailable.complete(); | |||
_serviceAvailable.complete(service); |
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.
This does some surgery on the
ServiceConnectionManager
class to make one Completer private, and ensure that we reset some minimal state between connections.