Skip to content

Desktop: a saved server target that never answers leaves startup with no deadline and no recovery screen #1524

Closed as not planned

Description

@SawyerHood

Problem

A saved server target that accepts the TCP connection and never answers leaves the desktop startup load pending. There is no deadline, so the app stays on the loading view until Chromium ends the request itself. The user gets no recovery screen and no way out except the Window ▸ Server menu.

The unbounded wait is here:

  • apps/desktop/src/remote-server-load.ts:32 — await args.loadUrl({ url: args.serverUrl }).
  • That call reaches loadUrlIntoWindow() in apps/desktop/src/desktop-window-factory.ts:197, which awaits BrowserWindow.loadURL with no timeout.

A half-open server is a plausible state: a reverse proxy that accepts and stalls, a tunnel that holds the socket open after the far end dies, or a bb server that is starting and not yet serving.

This is pre-existing

PR #1519 did not cause this. Before that change, applyServerTarget() already did await loadWindowUrl({ url: target.url }) with no deadline. #1519 added a catch around the same await, so it fixed the rejection path and left the never-resolves path as it was.

What #1519 already covers

An unreachable host rejects fast, and those cases now show a named recovery screen with Retry and Use This Mac. Measured in Electron 41.7.0:

Case Rejection Time
Unresolvable host ERR_NAME_NOT_RESOLVED (-105) about 1 s
Closed port ERR_CONNECTION_REFUSED (-102) about 1 s
Unreachable host over a tunnel (the report in #1494) ERR_FAILED (-2) about 1 s

So this issue is only about the load that never settles either way.

A naive deadline is wrong

Do not add a plain timeout race. The people this path serves reach their server over Tailscale or a similar tunnel, where a slow first load is normal. A short deadline would abort a slow but healthy load and would break the users #1494 set out to help.

A correct fix needs all of the following:

  1. webContents.stop() on timeout. Without it the request stays in flight behind the timeout screen.
  2. Care that the aborted request cannot change state afterwards. loadUrlIntoWindow() treats ERR_ABORTED as success (apps/desktop/src/desktop-window-factory.ts:206), so the stopped load resolves as though it worked. It must not mark the workspace open over the timeout screen, and it must not clear the recovery token of the visible view.
  3. A deadline chosen against real tunnel latency, not a guess. A first paint over a sleeping-then-waking Tailscale link can take many seconds.
  4. The same recovery screen as the other failures, so the outcome stays one design.

Expected

A saved target that never answers ends in the shared startup error screen, with Retry and Use This Mac, after a deadline that a healthy tunnel load can still meet.

Context

AGENT GENERATED: by Claude Opus 5

Activity

  1. SawyerHood commented on Aug 13, 2026

    @SawyerHood
    CollaboratorAuthor

    Closing. This was filed automatically by an agent during the 13 Aug 2026 issue sweep as a follow-up to a pull request. Sawyer is closing the sweep follow-ups rather than carrying them as backlog.

    The analysis above stands on its own and is preserved here. Reopen if it becomes relevant.

    AGENT GENERATED: by Claude Opus 5

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions