Repository navigation
fix(mobile): keep directly paired servers hidden from the first frame after launch - #52212
Conversation
…relay list is read A cold launch applied restored server rows before this launch's relay list was read, so a server the phone pairs with directly flashed under the desktop and stayed there while the desktop was unreachable. Each server-workspaces reply now records which servers were hidden when it was read, and a restored reply hides those until the relay list is read again; nothing waits on the network.
[Low impact] The changes appear safe to merge. SummaryRemembers which directly paired servers should stay hidden when saved workspace rows first appear.
No actionable issues found. Acknowledged limitation: AmoabaKelvin noted that a record made before the phone drops its direct pairing keeps that server hidden until this launch reads the relay list. Reviews (1) · Last reviewed commit: "fix(mobile): keep directly paired server..." · Reviewed by Greptile |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
ELI5
When the phone pairs with a server directly, the Mac's copy of that server is hidden from the Mac's workspace list (#51647). But on a cold launch the phone painted the saved list before it had asked the Mac which servers to hide, so the hidden server's workspaces could flash under the Mac, and stayed there while the Mac was unreachable. Now the saved list remembers which servers were hidden, so they stay hidden from the first frame.
What Changed
hiddenHostIds: the relayed servers the phone paired with directly when the reply was read, taken from the relay-hosts feed's listing.listedServerWorkspacesuses that record until this launch's relay list is read, and the live listing after that. Nothing waits on the network, so the first paint isn't delayed.Why
The hide decision depends on the relay list, which a cold launch hasn't read yet. Carrying the last known decision with the saved rows means the first paint already matches the rest of the session, instead of either flashing the hidden rows or holding every server row back until the network answers.
Linked Issue
Part of #40079 and #27988. This is a follow-up to #51647.
Visual Proof
N/A: no new UI. It removes a brief flash of rows that should already be hidden. The invariant is pinned in
server-workspaces.test.ts.Testing
The new case in
server-workspaces.test.tscovers the rule. A restored reply hides its recorded server while the listing is unknown, and once the listing is known, it decides. The test fails on main, which shows everything while the listing is null.Mobile typecheck, lint and the changed-files gate pass.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Performance
None, because it adds one set and one filter over the relayed servers per poll, plus a few ids in the stored query. There are no extra reads, RPCs or timers, and unchanged polls keep their identity.
Risk
Level: Low
AI Disclosure
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Page-only change: no store build.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)