Repository navigation
Commit ba8335a
fix(desktop): keep the attached server through a stall (#1721)
## Problem
A local server stalled for 3-5 s misses the 2 s discovery probe.
The desktop then drops the attachment, re-pairs, and remounts every window.
The remount's re-subscribe stalls the server again.
## Change
All in `DesktopAttachedPrimary.ts`.
### Grace
- **No answer:** keep the attachment for 30 s
- **Grace start:** the first failed verify
- **Grace reset:** any verify that answers
- **Late older verify:** cannot reset the grace
- **Held URL answers as itself:** counts as verified
### Bearer reads
- **In grace:** keep the held bearer
- **Failed session check:** keep the held bearer
- **`authenticated: false`:** re-mint, as before
### Drops at once
- **Another environment:** on the held URL
- **Undiscoverable server:** probe the held URL
- **Moved port:** before any descriptor fetch
- **Also:** a renderer reject
## Scope and approval
Refs #1720.
The maintainer asked for the desktop fix and the server fix.
The server stall cause stays open on the issue.
## Verification
### Tests
- **Unit tests:** 28 of 28 pass
- **New tests:** stall, session, late, recovery
- **Harness:** six inline fakes now share one
- **Test file:** 881 lines, down from 896
- **Mutation check:** each fails without its fix
- **Updated test:** a gone server drops after 30 s
### Checks
- **Typecheck:** `apps/desktop`, exit 0
- **Fork CI:** `vp run fork:ci`, exit 0
- **Not checked:** a live stall in the desktop app
Claude Code, claude-opus-5-5.
## Fork trailers
Squashes:
- 056b477 fix(desktop): keep the attached server through a stall (#1721) (#1721)
- ad32aac fixup! fix(desktop): keep the attached server through a stall (#1721) (#1721)
- f8e0113 fix(desktop): keep the attached server through a stall (#1721) (#1721)
- 7b623a2 fixup! fix(desktop): keep the attached server through a stall (#1721) (#1721)
Fork-Domain: backend-attach
Fork-Tier: bugfix
Fork-Upstreamable: no1 parent e905bde commit ba8335a
2 files changed
Lines changed: 377 additions & 364 deletions
0 commit comments