-
Notifications
You must be signed in to change notification settings - Fork 303
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
DevTools no longer opens in browser if a previous window was closed #3966
Comments
Turns out that this is working, but there is a 30 second delay between closing the browser and DevTools recording that client as gone. This is because the SSE connection has a 30 second keepalive so after closing the browser as far as DevTools is concerned, that client is still open for another 30 seconds and available for reuse: // Give connections time to reestablish before considering them closed.
// Required to reestablish connections killed by UberProxy.
const sseKeepAlive = Duration(seconds: 30); @jacob314 @kenzieschmoll I'm not sure there's a good solution here.. Reducing the SSE timeout may affect UberProxy users (based on the comment above). One option could be to just disable the reuse of windows from VS Code. This means if the user disables embedded DevTools and clicks the Inspector icon multiple times, we would launch a new window with the inspector each time (whereas today we still just show a browser notification saying "hey, you already have this one open here"). |
This issue has been marked stale because it is tagged awaiting-info for 20 days with no activity. Remove the stale label or comment to prevent the issue being closed in 10 days. |
This issue has been marked stale because it is tagged awaiting-info for 20 days with no activity. Remove the stale label or comment to prevent the issue being closed in 10 days. |
I would use a ping API first to verify the browser is still alive. |
Oops, didn't realise committing to another repo would close this. The change that landed in DevTools is only the first part, this requires some additional work in the server in the SDK. |
The other change is open at https://dart-review.googlesource.com/c/sdk/+/257581/. I've confirmed locally (using this method of running in VS Code) that it now re-uses the existing window if it's there, but opens a new one if not (although, it required a Ctrl+Refresh to bust the cache so the client responded to the ping). |
It's possible the browser has been closed but is in the SSE timeout period and therefore looks active. Ping it to see if it's actually responsive before deciding whether to reuse it or launch a new window. Fixes Dart-Code/Dart-Code#3966. Change-Id: I2fdcba036b8b63f7ab974e8fef5dd565c2917b64 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257581 Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com> Commit-Queue: Ben Konyi <bkonyi@google.com> Reviewed-by: Ben Konyi <bkonyi@google.com>
Fixed by dart-lang/sdk@70e8dc6. Will ship as part of an SDK, not Dart-Code. |
I think the DevTools server is not correctly handling the browser being closed, so it tries to reuse a connected client that doesn't exist (rather than launch a new one).
The text was updated successfully, but these errors were encountered: