Skip to content

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

Description

@DanTup

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.

Activity

  1. jacob314 commented on Apr 13, 2021

    @jacob314
    Contributor
  2. added this to the Backlog milestone on Apr 13, 2021
  3. added
    P2important to work on, but not at the top of the work list.
    devtools-cross-screenIssues that affect multiple DevTools screens, i.e. shared functionality and widgets
    on Aug 21, 2024
  4. DanTup commented on Sep 4, 2024

    @DanTup
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2important to work on, but not at the top of the work list.devtools-cross-screenIssues that affect multiple DevTools screens, i.e. shared functionality and widgets

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions