Skip to content

fix(mobile): show the build a managed server update reports, and read only while connected - #52848

Merged
AmoabaKelvin merged 1 commit into
mainfrom
mobile-managed-update-result
Nov 30, 2026
Merged

AmoabaKelvin merged 1 commit into
mainfrom
mobile-managed-update-result

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

After the phone updated a server the computer installed over SSH, the row could say "Updated" and then offer the same update again. That happened when the phone's next check didn't come through. Now it shows the build the update itself reported. Also, after a lost reply, the phone no longer asks the computer to check a server the computer has lost its SSH link to, because that would make the computer reconnect.

Files Added Deleted Net
Test 0 0 0 0
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​29 $\color{#cf222e}{\Huge{\mathbf{−}}}$​8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​21

What Changed

  • An answered update:
    • Before: the row took the server's build only from the status read that followed the update. A failed read left the old build and the same offer.
    • Now: the update's reply already names the build (activeVersion), so the phone writes it straight away and clears the offer for that build. The read still follows, to refresh the rest.
  • A lost reply:
    • Before: the follow-up status read ran no matter what. Through managedServer.status → resolveLinkedOrcadContext → connect, that can make the desktop dial a server whose SSH dropped.
    • Now: the row passes a check that asks the computer's own server list, waiting for the phone's reconnect if needed, as the read itself would. The read runs only when that list says the server is connected. That's the same gate the screen's own reads use. Otherwise the result stays "failed" and the next visit reads it.

Why

  • Root cause: the result of an update was decided by a second read instead of the update's own answer, and that read wasn't gated like every other read the screen makes.
  • Why this approach: using the reply removes the dependency for the normal case. The health check reuses the list the screen already reads.
  • What was ruled out: a check on the cached list alone. It reads empty during the phone's own reconnect, which is the usual way a reply gets lost, so successful updates would have stayed "failed".

Linked Issue

No GitHub issue. These are review follow-ups to #52332.

Visual Proof

N/A: no new screens or copy. It fixes which build and state an existing row shows after a failed read or lost reply, which a capture can't produce on demand. The store runs 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 were scripted runs of the real managed-server store against a fake desktop.

Case main now
Answered update, the read after it fails updated, build 0.1.0+old, offer 0.1.0+new still listed updated, build 0.1.0+new, no offer
Lost reply, the computer lists the server as down sends managedServer.status sends no status read, stays failed
Lost reply, the computer lists the server as up — reads, then updated

No committed test: this is store wiring that the runs above prove, and a unit test here would test a fake desktop. pnpm check:changed passes.

Performance

None, because only a lost reply adds work: one relay list read, shared with any in flight or served from the cache. A server listed as down then gets zero status reads. There are no new subscriptions, timers or polling.

Risk

Level: Low

  • Scope: phone only. No RPC or host changes, and the reply's activeVersion has always been part of the outcome.
  • Riskiest part: a lost reply while the computer lists the server as down now stays "failed" until the next visit, where before it was read at once.
  • 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

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)

… only while connected

"Updated to" took the server's build from the read after the update, so a failed read left the old
build and the same offer. The update's own reply names the build; it is shown at once. After a lost
reply the read waits for the next visit unless the computer's list says its SSH to the server is up,
so the phone never makes the desktop dial.
@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

ManagedServerRow now passes a callback that checks whether the target host is available. After a successful update, runManagedServerUpdate records the returned activeVersion and clears availableUpdate only when it matches. After a lost reply, the function skips the follow-up status read when the server is disconnected or its owner changed.

Merge Risk: Minimal · up to f205a

This change reports the update result from the reply's reported build and checks the computer's SSH status before reading server status after a lost reply. I found no concrete defect that should block merging. The one remaining edge case is a redundant status request for a server removed during the wait, and its result is discarded.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the two behavior changes in the diff: the row now shows the build reported by the managed server update, and the status read after a lost reply runs only while the server is connected.…
Description check Passed The description follows the repository template. It has ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill boundary, Notes, and Checkli…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the two behavior changes in the diff: the row now shows the build reported by the managed server update, and the status read after a lost reply runs only while the server is connected. The title is specific and matches the main changes. It is somewhat long at 90 characters, but it does not fail the check.

Full details: Description check

Explanation

The description follows the repository template. It has ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill boundary, Notes, and Checklist sections. The Visual Proof section gives a reason for N/A and the Performance section has a completed line. Two items are missing: the Risk level is filled in, but the AI Disclosure and Review sections are empty. The Linked Issue section cites no issue (it names review follow-ups to #52332 and says there is no GitHub issue), which the template requires for outside contributors. The unchecked test-quality box also leaves an open question about added tests.

Resolution

Consider these improvements: link a real issue in the Linked Issue section, or explain why none applies. Fill in or mark N/A the AI Disclosure section. Confirm the unchecked test-anti-pattern item, or explain why no committed test was added.

  • 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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 706f4e1a-8fcc-487d-88b5-2c034f2beae2
Commits

Reviewing files that changed from the base of the PR and between f11dc4e and f205a25.

Files selected for processing: 2

  • mobile/src/host-screen/identity/updates/HostServerUpdateRows.tsx
  • mobile/src/host-screen/identity/updates/host-managed-server-update.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@AmoabaKelvin
AmoabaKelvin merged commit 578fa6a into main Nov 30, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant