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): keep phone update rows true to the computer's latest answer - #52206
A batch of small fixes to the phone's "update your computer" screens, so what they show always matches what the computer last said.
Files
Added
Deleted
Net
Test
0
0
0
0
Prod
8
$\color{#1a7f37}{\Huge{\mathbf{+}}}$247
$\color{#cf222e}{\Huge{\mathbf{−}}}$115
$\color{#1a7f37}{\Huge{\mathbf{+}}}$132
What Changed
Agent CLI rows:
"Updated to X" keeps the version the run started for. Before, a check finishing during the run could turn it into a bare "Updated", or a newer version than was installed.
A check sent before an update landed can't offer that update again. Ordering uses a revision counter, not timestamps that can tie within a millisecond.
After an answered run, the phone reads the list again, so a CLI another client updated meanwhile drops off.
A queued recheck goes out on the newest client the screen handed in, not one an endpoint change already closed.
Orca row and update sheet:
Status reads are numbered, so a slower older reply can't replace a newer one.
After a restart, the row keeps the version it verified even if the next status read fails, and the old offer is dropped.
If another client installed the update first, the sheet says "Orca is up to date" instead of offering Download again. It's cleared once the sheet closes.
A failed update stops naming its version once the computer reached it or later (hasReachedAppVersion), so a newer offer shows.
"How to update" stays visible beside the CLI "Updated rows leave the list…" note.
Shared notice: an optional recheck action, which Jira uses to keep Check again on its update notice. The notice is the screen's only way out once the computer is updated.
No behaviour change: the Orca update's RPC transport moves into its own file to stay under the line cap.
Why
These were correctness gaps in the update screens from #51707, #51708 and #51710. Each fix sits in the store that owns the fact: the run's target in the CLI run, read order in the snapshot reads, and the verified version in the restart stage's result. None of them adds a new read on an idle screen.
N/A: no new layout. These fix what existing rows and the existing sheet show in race and failure cases, which a capture can't reproduce on demand. They were checked by running the production stores in memory against stubbed RPCs, during review: CLI target, revision and client ordering, Orca reply ordering, teardown, and a post-restart read failure. The only new text, "Orca is up to date" in the sheet, uses the same state view as "Updated to X".
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
Review: Codex found nothing; a Claude reviewer's two P2s are fixed in the second commit; the perf pass found nothing.
No new automated test: these are in-memory orderings in phone stores. The review exercised them with stubbed RPCs, and committing that harness would test mocks.
Performance
None that grows, because:
An answered run adds one CLI check, coalesced to at most one in flight plus one queued per computer. Bursts of 100 or 1,000 forced checks issue two.
Snapshot ordering keeps two numbers per live computer.
With nothing changing, nothing is published and nothing polls.
Risk
Level: Low
Riskiest part: the extra CLI check after each run. It's bounded per computer as above.
Mixed versions: no RPC, persisted state or route changes.
Phone release: native screens, so phones get it with the next app release.
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
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Not here: Korean strings for the shared notice (translation pass), and naming the computer when it, rather than a server, refuses a server-workspace delete. The refusal doesn't say which runtime refused, so that needs its own change.
A resumed download that ends on a newer version than offered already shows that version in the restart confirm, before any restart.
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)
CLI updates: the Updated-to version is the one the run started for; a
check sent before an update landed (counted, not timed) can't offer it
again; an answered run reads the rest of the list again; and a queued
recheck goes out on the newest client.
Orca update: an older status read can't replace a newer one; a finished
restart keeps the version it verified even if the next read fails; a
computer found already current says so instead of offering Download; a
failed update no longer hides a newer offer once the computer moved past
it; and How to update stays beside the CLI completion note.
The shared notice takes a screen's own recheck, so Jira keeps Check again.
… and settle a found-current one
A failed entry stops naming the version once the computer reached it or
later, so a newer offer shows. An update found already current is
settled whenever its sheet is closed, even if the check came back after
Cancel.
The host update flow now tracks CLI update revisions and retains the version targeted when a run began. Orca status reads use a host-specific transport and ordered snapshot publication. The update screen handles the current state, filters completed or reached targets, and can show CLI completion notes alongside Orca update steps. The screen notice also supports a recheck action, which Jira connection prompts provide when enabled.
Merge Risk: Low · up to 1ee91
Two narrow edge cases in the Orca update flow can leave the row showing an older version, or open the sheet with a spinner and an enabled Restart button that has no impact list. Both recover on a later read or on reopening the sheet. They are worth fixing before merge but are not severe.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: phone update rows (Agent CLI and Orca) are kept in line with the computer's latest answer. The changeset covers race and stale-state fixes in those mobile update scree…
Description check
The description follows the template well. It has an ELI5 section, What Changed, Why, a linked-issue note explaining there is no GitHub issue (follow-ups to #51707, #51708 and #51710), Visual Proof ma…
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: phone update rows (Agent CLI and Orca) are kept in line with the computer's latest answer. The changeset covers race and stale-state fixes in those mobile update screens, so the title is related to the primary change. It uses the conventional commit form and is concise, but it does not name the specific mechanisms (revision ordering, read sequencing, recheck action).
Full details: Description check
Explanation
The description follows the template well. It has an ELI5 section, What Changed, Why, a linked-issue note explaining there is no GitHub issue (follow-ups to #51707, #51708 and #51710), Visual Proof marked N/A with a reason, Testing, Performance, Risk with level and back-out plan, and the checklist. Gaps: the Testing section leaves the manual-testing and test-anti-pattern boxes unchecked, the 'Linked Issue' section does not meet the template's rule that an outside contributor must link an issue (the author is likely a maintainer, so this is acceptable), and the AI Disclosure and Review sections are empty. The 'Level' field is filled in. The Visual Proof section relies on in-memory store checks rather than before/after captures, which the template says are required for behavior changes. The 'pnpm lint, typecheck, test, and build' checklist item is unchecked, though the Testing section says pnpm check:changed passed.
Resolution
Optionally: tick the manual-testing box if it was done, fill in or delete the empty AI Disclosure and Review sections, and confirm whether the pnpm lint/typecheck/test/build checklist item was run. Consider stating why no before/after capture is possible for the Visual Proof section, since it is required for behavior changes.
Finishing Touches
Fix failing CI checks
Commit to this branch
Create a new PR
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; 9 remain after this review.
…on past settlement
A failed update the computer has since passed is dropped before the sheet
opens on the newer offer. Settling a finished or found-current update now
keeps the version it verified in the row until a fresh read replaces it,
and a late-answered CLI run reads the list again too.
The reason will be displayed to describe this comment to others. Learn more.
Closing restores an old version
A current entry keeps version X while the sheet stays open. If the computer updates to Y and a reconnect refreshes snapshot, closing the sheet copies X back and clears any newer offer with status: { state: 'idle' }. The phone then shows the older version and hides the newer update until another status read. Keep a newer snapshot instead of always preferring the finished entry.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Settlement can replace a newer status snapshot with the stage's older version.
When an entry is updated or current, settlement writes entry.currentVersion into the stored snapshot whenever that version differs from snapshot.appVersion. A status read that succeeds after a restart can store a newer version, for example 3, while the entry still records version 2. Settlement then stores version 2 with idle status and clears the entry. The newer offer is removed until another status read runs. The row also reports an older version than the computer runs.
The restart path must keep the stage's version when the post-restart read fails. Settlement must not replace a snapshot that a later status read has already published. Record the read number that published the stage's version. In settleHostOrcaUpdate, skip the snapshot write when a newer read has been shown for this owner.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Start the download path when a discarded failure is replaced by a newer offer.
openSheet discards a failed entry that the computer has moved past, but it tests the render-time orca.entry afterward. The download branch therefore sees a failed entry and does not run. The newer downloaded offer opens with entry and impact both null. The sheet shows the restart-impact spinner, and Restart stays enabled without a list of what the restart stops. The download and impact read start only after the sheet is closed and reopened.
Compute the discard condition before the discard, and route a discarded entry to the download path:
Suggested fix
--- "a/mobile/src/host-screen/identity/updates/HostUpdatesSection.tsx"+++ "b/mobile/src/host-screen/identity/updates/HostUpdatesSection.tsx"@@ -182,20 +182,24 @@
onRestart={() => void restartHostOrcaUpdate(connections, hostId)}
/>
)
const openSheet = () => {
// A failure the computer has since moved past would hide the newer offer this row shows.
- if (orca.entry?.phase === 'failed' && !entryOutstanding) {+ const discardFailed = orca.entry?.phase === 'failed' && !entryOutstanding+ if (discardFailed) {
discardHostOrcaUpdate(hostId)
}
setSheetOpen(true)
// The confirm names what's running now, not when the download finished.
if (orca.entry?.phase === 'downloaded') {
void refreshHostOrcaRestartImpact(connections, hostId)
- } else if (!orca.entry && orca.snapshot?.status.state === 'downloaded') {+ } else if (+ (!orca.entry || discardFailed) &&+ orca.snapshot?.status.state === 'downloaded'+ ) {
// Already downloaded on the computer: straight to who restarts.
void downloadHostOrcaUpdate(connections, hostId, props.hostName)
}
}
const openedFromNotice = useRef(false)
useEffect(() => {
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
A batch of small fixes to the phone's "update your computer" screens, so what they show always matches what the computer last said.
What Changed
hasReachedAppVersion), so a newer offer shows.recheckaction, which Jira uses to keep Check again on its update notice. The notice is the screen's only way out once the computer is updated.Why
These were correctness gaps in the update screens from #51707, #51708 and #51710. Each fix sits in the store that owns the fact: the run's target in the CLI run, read order in the snapshot reads, and the verified version in the restart stage's result. None of them adds a new read on an idle screen.
Linked Issue
No GitHub issue; follow-ups to #51707, #51708 and #51710.
Visual Proof
N/A: no new layout. These fix what existing rows and the existing sheet show in race and failure cases, which a capture can't reproduce on demand. They were checked by running the production stores in memory against stubbed RPCs, during review: CLI target, revision and client ordering, Orca reply ordering, teardown, and a post-restart read failure. The only new text, "Orca is up to date" in the sheet, uses the same state view as "Updated to X".
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
pnpm check:changedpasses (typecheck, lint, localization, focused tests).Review: Codex found nothing; a Claude reviewer's two P2s are fixed in the second commit; the perf pass found nothing.
No new automated test: these are in-memory orderings in phone stores. The review exercised them with stubbed RPCs, and committing that harness would test mocks.
Performance
None that grows, because:
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
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)