You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(mobile): ask a server's update status again when the read timed out - #52868
On the phone's Edit computer, a server's update row could go missing for the whole visit, because the one status check for it timed out. Nothing asked again until you left the screen and came back. Now a check that didn't answer is retried a few times while you're on the screen.
Files
Added
Deleted
Net
Test
0
0
0
0
Prod
2
$\color{#1a7f37}{\Huge{\mathbf{+}}}$139
$\color{#cf222e}{\Huge{\mathbf{−}}}$87
$\color{#1a7f37}{\Huge{\mathbf{+}}}$52
What Changed
Before: Edit computer read each listed server's update status once per visit. A read that failed was asked again only when the screen's inputs changed (client, capabilities, server list, online). The server list keeps its identity while nothing in it changes. So a status read that timed out while the computer stayed connected left the server's row missing until the screen was reopened.
Now: a read that didn't answer is asked again after 15 s. The limits:
At most 3 retries per server per visit, checked whenever a read is sent, so a timer set for one server never re-asks another that has used its retries.
Only while Edit computer is in front and the app is in the foreground. Going to the background cancels the timer, and coming back asks what's still unanswered.
Only servers the computer lists as reachable, the same gate as before, so a retry never makes the desktop dial.
A failure that lands after the server list changed is retried by the current run, so a list change while a read was out loses nothing.
No behaviour change: the visit reader moved from HostServerUpdateRows.tsx to use-read-server-updates.ts to stay under the line cap.
Why
Root cause: the reader had no retry of its own and depended on its inputs changing, which a timeout doesn't cause.
Why a bounded, foreground-only retry: it fixes the missing row without adding steady polling. Answered servers are never asked twice in a visit, and nothing runs when nothing failed.
Linked Issue
No GitHub issue. This is a review follow-up to #52332.
Visual Proof
N/A: no new screens or copy. A row that a timed-out read left missing now appears after the retry, and a timeout can't be produced on demand on a device. Hook runs with fake timers are below.
Testing
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
These ran the real hook under react-test-renderer, with fake timers and a fake desktop:
Case
Reads
One timeout, then an answer
2, then none
Never answers
4 (1 plus 3 retries), then none
Two servers failing at different times
4 each
The server list changes while a read is out, then it fails
retried (2)
Failure, then the app goes to the background for 2 minutes
no reads while hidden; one read on return
Unmount or blur
no further reads
No committed test: this is screen read scheduling, which the runs above cover. pnpm check:changed passes.
Performance
None when nothing fails: no timers and no extra reads. A failing server adds at most 3 reads per visit, at least 15 s apart. A single timer covers all servers. Work happens only while the screen is focused and the app is in the foreground, with no work while hidden.
Risk
Level: Low
Scope: phone only, with no RPC or host changes.
Riskiest part: an older server that keeps refusing the status read now gets 3 more cheap failed calls per visit.
Back out: a plain revert.
AI Disclosure
Review
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Reads keep their host scoping: relayed servers go through runtime:<env>, and SSH-managed servers through the desktop with skipTerminalCensus.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
Edit computer read each server once per visit and asked again only when the server list changed, so
a status read that timed out while the computer stayed connected left the server's row missing until
the screen was reopened. A read that didn't answer is now asked again after 15 s, up to three times
per visit, and only while the screen is in front.
The server-update read logic moves from HostServerUpdateRows.tsx into the useReadServerUpdates hook. The hook reads updates under the existing focus, app activity, connectivity, host-list, and server-availability conditions. It retries failed or unanswered reads after 15 seconds, up to three times per server per visit. It also removes updates for unlisted servers and settles listed updates when focus ends.
Merge Risk: Low · up to 06cdf
The new retry logic can fire its retries early when the server list changes right after a failed read, so a server's update row may give up before the intended 15-second spacing has passed. Impact is limited to the Edit computer screen on the phone and to at most three extra reads per server per visit. It is mergeable, but the retry cooldown should be preserved across host-list changes.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: a server's update status read is retried after a timeout. It matches the changeset, which adds a bounded retry for unanswered reads in the mobile Edit computer screen.…
Description check
The description follows the template sections: ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checkli…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: a server's update status read is retried after a timeout. It matches the changeset, which adds a bounded retry for unanswered reads in the mobile Edit computer screen. The title is specific and follows the fix(mobile) convention.
Full details: Description check
Explanation
The description follows the template sections: ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. It explains the before and after behavior, the retry limits, the mechanism, and the risk with a back-out plan. It gives the performance reasoning and a visual proof N/A reason. Gaps: the Linked Issue section names no issue number (it cites a review follow-up to #52332 instead), the Risk level is given, and the 'Every added test fails without this change' box is unchecked, which the author explains by saying no test is committed. The Review and AI Disclosure sections are empty.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Preserve the retry cooldown when the host list changes.
If a read resolves false and hosts changes one second later, cleanup cancels the retry timer. The replacement run immediately reads the same server here. Repeated list changes can consume the retry budget without the required 15-second spacing.
Track the next eligible read time per key. Keep initial reads for newly listed servers immediate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
On the phone's Edit computer, a server's update row could go missing for the whole visit, because the one status check for it timed out. Nothing asked again until you left the screen and came back. Now a check that didn't answer is retried a few times while you're on the screen.
What Changed
HostServerUpdateRows.tsxtouse-read-server-updates.tsto stay under the line cap.Why
Linked Issue
No GitHub issue. This is a review follow-up to #52332.
Visual Proof
N/A: no new screens or copy. A row that a timed-out read left missing now appears after the retry, and a timeout can't be produced on demand on a device. Hook runs with fake timers are below.
Testing
These ran the real hook under react-test-renderer, with fake timers and a fake desktop:
No committed test: this is screen read scheduling, which the runs above cover.
pnpm check:changedpasses.Performance
None when nothing fails: no timers and no extra reads. A failing server adds at most 3 reads per visit, at least 15 s apart. A single timer covers all servers. Work happens only while the screen is focused and the app is in the foreground, with no work while hidden.
Risk
Level: Low
AI Disclosure
Review
Agent skill upstream boundary
Notes
Reads keep their host scoping: relayed servers go through
runtime:<env>, and SSH-managed servers through the desktop withskipTerminalCensus.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)