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

DevTools fails to load through proxies that don't support SSE #2892

Open
DanTup opened this issue Apr 13, 2021 · 2 comments
Open

DevTools fails to load through proxies that don't support SSE #2892

DanTup opened this issue Apr 13, 2021 · 2 comments
Labels
cross-screen Issues that affect multiple DevTools screens, i.e. shared functionality and widgets P2 important to work on, but not at the top of the work list.
Milestone

Comments

@DanTup
Copy link
Contributor

DanTup commented Apr 13, 2021

I tried to launch DevTools in a cloud editor that doesn't support SSE (its connections will just hang indefinitely) and it failed to load (just leaving a white screen after printing the version number to the console).

The network tab looks like this:

Screenshot 2021-04-13 at 10 36 45

I can't easily confirm, but I think it will be hanging on this await here:

await preferences.init();

That init() call tries to use storage which will be a ServerConnectionStorage because DevToolsServerConnection.connect does not return null here:

// Here, we try and initialize the connection between the DevTools web app and
// its local server. DevTools can be launched without the server however, so
// establishing this connection is a best-effort.
final connection = await DevToolsServerConnection.connect();
if (connection != null) {
setGlobal(Storage, ServerConnectionStorage(connection));

It doesn't return null, because in connect() the call to api/ping works fine (it's not SSE), which then unconditionally creates an SseClient:

static Future<DevToolsServerConnection> connect() async {

If we want to support this, I think there are two options:

  1. Support WebSockets instead of SSE for this API (DWDS already has some abstractions over SSE+WebSockets that could probably be taken)
  2. Change this code to detect that SSE is not responsive and return null (this would effectively disable the server though, which may affect some functionality)

@devoncarew @jacob314 I don't know if this is currently worth pursuing, but thought it was worth capturing the issue somewhere perhaps to come back to.

@jacob314
Copy link
Contributor

Fyi @grouma

@jacob314 jacob314 added this to the Backlog milestone Apr 13, 2021
@elliette elliette added P2 important to work on, but not at the top of the work list. cross-screen Issues that affect multiple DevTools screens, i.e. shared functionality and widgets labels Aug 21, 2024
@DanTup
Copy link
Contributor Author

DanTup commented Sep 4, 2024

Another issue I believe is caused by SSE is not being able to open > 5 DevTools tabs, see #8298. If the fix for that issue is to switch from SSE to WS, that may also resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cross-screen Issues that affect multiple DevTools screens, i.e. shared functionality and widgets P2 important to work on, but not at the top of the work list.
Projects
None yet
Development

No branches or pull requests

3 participants