Repository navigation
Description
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()inapps/desktop/src/desktop-window-factory.ts:197, which awaitsBrowserWindow.loadURLwith 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:
webContents.stop()on timeout. Without it the request stays in flight behind the timeout screen.- Care that the aborted request cannot change state afterwards.
loadUrlIntoWindow()treatsERR_ABORTEDas 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. - A deadline chosen against real tunnel latency, not a guess. A first paint over a sleeping-then-waking Tailscale link can take many seconds.
- 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
- Reported as a review finding on [issue sweep] Recover from an unreachable saved server target #1519, which fixes the rejection path of Desktop: an unreachable saved remote server target leaves the app on a dead-end startup error #1494.
- Recovery screen and token guard:
apps/desktop/src/local-view.ts,apps/desktop/src/startup-error-ipc.ts.
AGENT GENERATED: by Claude Opus 5
Activity
SawyerHood commentedon Aug 13, 2026
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.
Recover from an unreachable saved remote server target (#2161)