Repository navigation
fix: show an in-app update armed elsewhere on every update surface - #35707
Conversation
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fix is anchored in #34444 and reads the gateway's single arm record, the server state every copy already queries, instead of adding another shared state to keep in sync. What this change shipsInventory (6 items) — 6 justifiedIntent: when someone arms an in-app update from one update surface, every other surface shows that arm instead of offering a second one. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 3db174d Description read[DESCRIPTION-READ] 08bebd37047054f63f3eab0715467f01546f703040bd8bd63f6b9639253f2615 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the shared gateway arm is now read from the one shared status query, so the fix goes at the root cause (each copy keeping its own step) and changes no API or stored data. Notes
[DESIGN-REVIEWED] 3db174d Description read[DESCRIPTION-READ] 47e5a9ee9efcb67d748266109b783eaa2335f4f9cbbdd28f5101345bb36923dc That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The PR adds no new control or string: it reuses the existing armed panel on more surfaces, and shots 02, 03, 06 and 07 show that panel on Settings > About. Notes
[UX-REVIEWED] 3db174d Description read[DESCRIPTION-READ] bb8df7289ed0966c147f23160889543a31c5ff34e4820c246b7ff381d28c2057 That sha256 names everything this verdict read: the PR description, plus the 10 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Code change approver recommendation: A person should decideWhy: the decider raised 3 possible problems and estimates a 55% chance that this change introduces a defect; a person should check them. The fix covers the two common cases: a copy that opens after another copy armed, and two copies on screen at once. Both are tested. The stated goal still fails on concrete paths. Try again sets a fresh timestamp but never reads the gateway again: with staleTime Infinity, turning a query back on does not refetch. Copies in the expired or failed state never adopt an arm another surface made. The PR also adds a race: the read a copy makes when it opens is not cancelled before the arm result is written, so a late armed:false answer can move the arming copy to 'applying' and hide its approval command. Each fix is small: refetch on Try again, adopt in the expired and failed states, and call cancelQueries before setQueryData. Things to check (possible problems the decider raised; at this confidence many turn out to be fine):
An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
Settings > About, What's new and the update-found dialog each mount their own copy of the in-app update flow, and each kept its step to itself. Arming in one left the others offering "Update to" while the gateway already held the arm and waited for its approval. A copy that shows the offer (first shown, after Try again, after its own arm expired or ended without an update) now shows a live in-app arm read from the gateway since then as armed, with the approval command and the time left. The copy that arms cancels any read still in flight and writes its arm into that shared read, so a copy already on screen follows at once. The packaged desktop app's request stays with its own request card. Closes #34444
64073e1 to
3db174d
Compare
|
Rebased: main moved in website/src/pages/settings/AboutPanelUpdateFlow.tsx (same file) and 38 files beside the ones this PR touches, and it now carries #35625, the fix for the two Windows backend reds this head's CI hit on main's tree (test_wait_discipline_ratchet, test_updates_handlers_facade) (f9788c5 -> 9ae8d25); CI re-running. |
|
self-added: yes
|
|
self-added: yes
|
|
|
[operator: bolichen97] Thanks; the three points to check are handled in 3db174d:
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (2 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: the in-app update flow adopts a live arm made by another surface instead of offering a second arm, with tests.
Problem / Motivation
Goal: An in-app update armed on one update surface shows as armed on every other one, instead of a second "Update to" offer.
Arm an in-app update from What's new (or the update-found dialog), close it and open Settings > About: About still offers "Update to v0.6.0" as if nothing were armed, although the gateway holds the arm. Reported in #34444.
Why it matters
The user is told to run an approval command on the gateway host, then the next screen they look at says no update was started. They either arm a second time or wonder whether the first click did anything. Anyone on a managed install who arms from a dialog and then opens Settings is hit.
Not a goal
GET /api/update/armalready reports the live arm.What changed (motivation → approach → change)
The in-app update flow is shown in three places (Settings > About, What's new, the update-found dialog), and each copy kept its own step: only the copy that was clicked ever left "Update to". The gateway has one arm, but no other copy asked it.
Now a copy reads the gateway's arm status every time it puts the "Update to" offer up: when it appears, after Try again, and when its own arm expired or ended without an update. The read goes past the dashboard's cache, whose answers never go stale on their own. If the gateway reports a live in-app arm, the copy shows the armed panel for it: the approval command and the time left. Like the arm click, it first clears an earlier attempt's progress, which a live arm always postdates, so an old failure cannot cover the arm. A copy that arms also writes its arm into that shared status read, so a copy already on screen (About under the dialog) switches at once.
Three guards keep a wrong answer out. A copy only adopts an answer read after it last put the offer up, so a cached answer from before an approval or an expiry cannot bring an old arm back. The copy that arms stops adopting before it writes the shared read, so it keeps the version it armed rather than taking its own arm back without it. And it cancels any status read still in flight before writing, so an earlier "nothing armed" answer cannot land after the arm and pass for the approval.
Backwards compatibility
Compatible: no API, stored data or setting changes; an update panel additionally calls the existing
GET /api/update/armonce each time it shows the "Update to" offer.Removes nothing: every control and state the panel had is still reachable the same way.
Tests
website/src/test/AboutPanel.inAppApply.test.tsx:failedprogress is in the store; the copy shows the live arm and its approval command, not the failure.The new tests run on the dashboard's own query client (cached answers never go stale). With the production change reverted, the first six fail; the seventh fails against an earlier version of this change that did not read again when the wait for an apply ran out. With the change, the whole file passes in five shuffled orders (
--sequence.shuffle, seeds 11, 23, 37, 41, 59), the first six pass ten runs in a row, and the 25 spec files that mount an update surface (359 tests) pass on this head, which sits on the currentmain.Proof: not provable -- frontend test (prove.py runs Python only)
Manual verification
Full SPA from a loopback Vite dev server of this head, with every
/api/*answered by a scripted stub (no gateway: an isolated gateway cannot reach the managed-install armable state), driven with Playwright, in two runs:Screenshots / video
Arm in the update-found dialog, which opens over Settings > About:
After closing the dialog, Settings > About shows that arm with its approval command:
The dialog's first arm lapses unapproved, which leaves About under it at "approval window expired". The dialog arms again, and once it closes About shows that arm instead of a second offer:
Without this change, the same dialog-then-About steps leave About offering a second arm:
Dark theme
Related Issues
Closes #34444
Sibling sweep
Swept: git grep -nE "queryKey: ['update-arm-status']" -- website/src
Sibling: website/src/pages/settings/AboutPanel.tsx:241 -- not affected -- the agent request card renders straight from the shared query data it polls every 5 s, so every mount shows the live request within one poll
Sibling: website/src/pages/settings/AboutPanelUpdateFlow.tsx:429 -- changed here
Pattern harvest
Rule candidate: review-prompt
Pattern: a component mounted on several surfaces keeps a server record's state in its own useState, so only the copy that changed it shows the change
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)