Skip to content

fix: show an in-app update armed elsewhere on every update surface - #35707

Merged
bolichen97 merged 1 commit into
mainfrom
fix/34444-adopt-live-arm
Nov 12, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/34444-adopt-live-arm

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Changing what the gateway stores or returns: GET /api/update/arm already reports the live arm.
  • The packaged desktop app's update request, which has its own request card.
  • Naming the armed version on a surface that did not make the arm: the status read carries only the raw version, and folding it in the browser would copy the gateway's display rule.

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/arm once 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:

  • shows an arm another surface made instead of offering a second one: one copy arms and unmounts, then Settings > About mounts on the same client; About shows the armed panel with the approval command, and no second arm is sent.
  • shows one copy's arm on another copy that is on screen at the same time: two copies on screen, the arm clicked in one; the other switches to the armed panel, and the one that armed keeps waiting for the approval instead of reading the earlier "nothing armed" answer as the approval.
  • shows an adopted arm instead of an earlier attempt's failure: an earlier apply's failed progress is in the store; the copy shows the live arm and its approval command, not the failure.
  • does not take a read that began before the arm for its approval: the copy's first status read is still out when the click arms, and its "nothing armed" answer lands afterwards; the panel keeps waiting with the approval command.
  • reads the arm again on Try again, so an arm made by another copy's retry shows: both copies show a failed attempt, the other copy retries and arms, then About's Try again shows that arm instead of a second offer.
  • shows an arm made elsewhere after this copy's own arm expired: About's own arm lapses, and the cached answer from before the lapse does not bring it back; when the dialog arms, About shows that arm.
  • reads the arm again when its own arm ends without an update: the arm goes away with no apply, another tab arms, and when the wait for an apply runs out the copy shows that arm.
  • The file's existing armed-version tests (names the version the gateway ACTUALLY armed… and the four after it) pin that the copy that armed keeps the armed version and its note.

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 current main.

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:

  • Arm in the update-found dialog over Settings > About and close the dialog: About shows the arm. The same script against the page code without this change leaves About on "Update to v0.4.7".
  • Arm in the dialog with a 3-second approval window and let it lapse: the dialog and About both show "approval window expired". Arm again in the dialog and close it: About shows the new arm, and its expired note is gone.

Screenshots / video

Arm in the update-found dialog, which opens over Settings > About:

The dialog after the arm

After closing the dialog, Settings > About shows that arm with its approval command:

About shows the arm made in the dialog

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:

About shows the new arm after its own arm expired

Without this change, the same dialog-then-About steps leave About offering a second arm:

Without this change: About still offers Update to v0.4.7

Dark theme

The dialog after the arm, dark

About shows the arm made in the dialog, dark

About shows the new arm after its own arm expired, dark

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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 12, 2026 01:43
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 12, 2026
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 3db174d0429094f217abf8ee5e92fe1aced4d51e — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 ships

Inventory (6 items) — 6 justified

Intent: 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.

  1. Settings > About, What's new and the update-found dialog now show an arm made on another surface as armed, with its approval command and time left, instead of "Update to". — justified
  2. A surface already on screen switches to armed as soon as another surface arms. — justified
  3. A surface that picks up a live arm drops an earlier attempt's failure message instead of showing it over the arm. — justified
  4. Each time a surface shows the "Update to" offer (on open, after Try again, after its own arm expires, after an apply that never started), it makes one GET /api/update/arm read. — justified
  5. An arm picked up from another surface does not name its display version. — justified
  6. A status read that started before an arm can no longer land afterwards and be taken for the approval. — justified

[FIRST-PRINCIPLES-REVIEWED] 3db174d

Description read

[DESCRIPTION-READ] 08bebd37047054f63f3eab0715467f01546f703040bd8bd63f6b9639253f2615

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 3db174d0429094f217abf8ee5e92fe1aced4d51e — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • The fix leaves one pattern in place: each copy of the update flow still keeps its own copy of the arm and repairs it with ordering guards (idleSince, cancel before writing). If a fourth surface or another arm state turns up, render the armed state straight from ['update-arm-status'] instead of adding more guards.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 3db174d0429094f217abf8ee5e92fe1aced4d51e — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • On mount and on Try again, the "Update to vX" button stays up until the arm-status read returns, so it can flash and be clicked once before the armed panel replaces it. Disable or hide "Update to" while that read is in flight.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 3db174d0429094f217abf8ee5e92fe1aced4d51e — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 3db174d

Verdict parsed from the review's SHA-scoped output markers for commit 3db174d0429094f217abf8ee5e92fe1aced4d51e.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 3db174d0429094f217abf8ee5e92fe1aced4d51e false-positive: <reason, 20 to 500 characters>

@bolichen97
bolichen97 enabled auto-merge (squash) November 12, 2026 01:48
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 3db174d0429094f217abf8ee5e92fe1aced4d51e and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 3db174d

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 3db174d0429094f217abf8ee5e92fe1aced4d51e false-positive: <reason, 20 to 500 characters>

@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: 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):

  • The description says a copy adopts a live arm read 'when it appeared, or after Try again', but nothing re-reads the gateway on Try again. Concrete path: About shows a failed attempt, the overlay arms and closes, then the user presses Try again in About. About offers 'Update to' again while the gatew (website/src/pages/settings/AboutPanelUpdateFlow.tsx, medium)
  • A copy in the 'expired' phase still shows 'Update to', but it never adopts an arm another surface makes. Example: About's own arm expires, the update-found dialog over it arms, the dialog closes, and About still offers a second arm next to the 'approval window expired' note. The stated goal says eve (website/src/pages/settings/AboutPanelUpdateFlow.tsx, low)
  • This race is new: on main the poll was disabled while idle, so no read made before the arm could be in flight. If it fires, the user loses the approval command and the panel sits in 'applying' while the gateway is still waiting for approval. It is unlikely in practice, but the fix is one cancelQuer (website/src/pages/settings/AboutPanelUpdateFlow.tsx`, low)

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 64073e14bf · 135 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 12, 2026
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
@bolichen97
bolichen97 force-pushed the fix/34444-adopt-live-arm branch from 64073e1 to 3db174d Compare November 12, 2026 12:52
@bolichen97

Copy link
Copy Markdown
Contributor Author

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.
[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: the arming copy cancels every arm-status read in flight before it seeds the shared read

  • span=c133550b2c33 An outstanding idle read can overwrite the newly armed state

fixed in 3db174d: the arm's onSuccess calls queryClient.cancelQueries({ queryKey: ['update-arm-status'] }) before setQueryData; in TanStack 5.96 the cancel reverts synchronously and the settled retryer drops the late answer, so a read that began before the arm can no longer land over the seed and pass for the approval.
Pinned by does not take a read that began before the arm for its approval, red without the cancel.
[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: every entry into a phase that shows the offer (mount, Try again, an expiry, an apply that never started) stamps the adopt window and re-reads the arm status

  • span=c133550b2c33 Try again rejects the current arm without refreshing status

fixed in 3db174d: one effect on the offer phases (idle, expired, ended) stamps the adopt window and calls the observer's refetch() each time the offer goes up, Try again included, so the copy reads the gateway again instead of rejecting the cached answer.
The same effect covers the sibling entries: a copy whose own arm expired or ended without an update also reads again and adopts a live arm.
Pinned by reads the arm again on Try again, so an arm made by another copy's retry shows, shows an arm made elsewhere after this copy's own arm expired and reads the arm again when its own arm ends without an update, each red without its change.
[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=c133550b2c33 Idle arm-status failures remain invisible

Rebutted: not-applicable. errors-use-error-notice says how an error the panel SHOWS is rendered (through ErrorNotice, with a hand-off decision); it does not require a best-effort background read to raise a notice, and this panel renders no hand-written error for that read.
The idle read only looks for an arm another surface made. When it fails, the copy keeps the "Update to" offer it showed before this PR, which still works: arming answers for itself, and its refusal renders through the existing arm-error ErrorNotice with askAgent.
A new idle notice would put an error on Settings > About whenever that read hiccups, about a state the user cannot act on, and needs a new string in every locale catalog: scope the issue does not need.
Once a copy is armed, where a missed read can hide the approval, the armed branch's arm-poll-error ErrorNotice already reports a run of failed reads.
[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] Thanks; the three points to check are handled in 3db174d:

  • Try again reads the gateway again: every moment a copy puts the "Update to" offer back up (it appears, Try again, its own arm expired, or the arm ended without an update) stamps a fresh window and re-reads, so About shows the overlay's arm instead of a second offer.
  • A copy in the expired or ended state adopts a live arm the same way. A failed copy shows no offer, and its Try again re-reads.
  • The arming copy cancels any arm-status read still in flight before it writes its arm, so a late "nothing armed" answer can no longer move it to applying.
    Each has a test that fails without its change.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 12, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bolichen97
bolichen97 merged commit e6f27e0 into main Nov 12, 2026
99 checks passed
@bolichen97
bolichen97 deleted the fix/34444-adopt-live-arm branch November 12, 2026 14:10
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 12, 2026
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.

In-app update armed from What's new is not shown on Settings > About

2 participants