Repository navigation
fix(settings): show the arm poll notices after three failed polls - #38160
Conversation
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fix counts whole failed polls at the cause: React Query restarts What this change shipsInventory (5 items) — 5 justifiedIntent: when the gateway stops answering the arm-status poll while an update waits for approval, the user is told the panel can no longer track it. FIX.
[FIRST-PRINCIPLES-REVIEWED] 0d881a7 Description read[DESCRIPTION-READ] edaa6b88f072cf2e1f0de930a03cad8e7b62e88fa5c7ebe1edd694cb24b9cb11 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: counting whole failed polls fixes the actual cause, which was React Query's per-fetch [DESIGN-REVIEWED] 0d881a7 Description read[DESCRIPTION-READ] ab21a2a23397ed01ca9bc5288b78a82b924ee2d5004a2644a8cba4156fb4daa8 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. This PR only changes when two existing notices appear. Their wording and controls are unchanged, and the screenshots show both before and after. Notes
[UX-REVIEWED] 0d881a7 Description read[DESCRIPTION-READ] 1745d2f2387ddb57c42cabe85fb65de0d2d261c9348af2252adb3e045bc9af28 That sha256 names everything this verdict read: the PR description, plus the 8 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: |
Two notices in Settings > About say the approval status could not be refreshed once the GET /api/update/arm poll keeps failing. They read React Query's failureCount, which restarts at every fetch, and the dashboard's retry policy retries a failure that is not a 429 once, so for a 500, a 502/503 or a dropped link the count stopped at 2 and the threshold of 3 was never reached. Both notices count failed polls in a row from the query's errorUpdateCount, restarting at every answer (dataUpdatedAt), which carry across fetches, and show on the third.
|
Rebased: main moved in [operator: bolichen97] |
2c612d7 to
0d881a7
Compare
Code change approver recommendation: ApproveWhy: the decider estimates a 10% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. The fix is correct: React Query restarts failureCount on every fetch, and retryPolicy retries anything other than a 429 only once, so the count never reached 3 for a 5xx or a dropped link. The new useArmPollFailing hook counts whole failed polls instead, using errorUpdateCount since the last dataUpdatedAt change. Any answer resets the count, including the arm click's setQueryData seed and an arm picked up from a poll. Because a fetch starting changes neither field, the notice no longer hides at each new poll. Both consumers read the same cached query ['update-arm-status'], so they share the same counts. The removed export ARM_POLL_FAILURE_THRESHOLD had one importer, and it now uses the hook. Both tests run on the production client (newQueryClient) with a 503 and would fail without the fix. CI is green, and every automated review lane found nothing blocking. Tier: 1, every tier gate passed. 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 |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved automatically by the code change approver, not by a person. The decider estimates a 10% chance that this change introduces a defect, within the 12% limit for approving on its own, and the change has at most 400 changed lines.
The fix is correct: React Query restarts failureCount on every fetch, and retryPolicy retries anything other than a 429 only once, so the count never reached 3 for a 5xx or a dropped link. The new useArmPollFailing hook counts whole failed polls instead, using errorUpdateCount since the last dataUpdatedAt change. Any answer resets the count, including the arm click's setQueryData seed and an arm picked up from a poll. Because a fetch starting changes neither field, the notice no longer hides at each new poll. Both consumers read the same cached query ['update-arm-status'], so they share the same counts. The removed export ARM_POLL_FAILURE_THRESHOLD had one importer, and it now uses the hook. Both tests run on the production client (newQueryClient) with a 503 and would fail without the fix. CI is green, and every automated review lane found nothing blocking.
Tier: 1, every tier gate passed.
Criteria: no merge conflict, no owner block, no change request, the default branch, no security-sensitive path, no design document to agree on, the readiness status, the review lanes, the P0 history, the linked issues' tier, the review lessons, no concern label, the file count, a safe change category, not its own change, the decider, the security checklist, the change matches its title, no competing change.
Decider v3c (217fe607). To overrule it, request changes or dismiss this review.
Problem / Motivation
Goal: The two "Couldn't refresh the approval status from the gateway" notices in Settings › About appear once three
GET /api/update/armpolls in a row have failed, for any failure: a 500, a 502/503, a dropped connection or a 429.Two notices in Settings › About wait for three failures of the arm-status poll:
arm-poll-errorin the armed in-app update, andagent-update-request-panel-erroron an agent's update request card. With the gateway answering 500 or 503 to every read, or the link dropped, neither ever appeared. Only a 429 showed one, and it hid again at the start of every poll.Why it matters
These notices exist for the moment the gateway stops answering while an update waits for its approval. For a 5xx or a dropped link they never appeared, so the approval could land, or the request expire, with nothing on screen saying the panel had lost track of it.
Not a goal
retryPolicyinwebsite/src/api/queryClient.ts).What changed (motivation → approach → change)
Both notices showed when React Query's
failureCountreached 3. React Query restarts that count at the start of every fetch, so it only counts one poll's retries, and the dashboard's retry policy retries a failure that is not a 429 once. For a 500, a 503 or a dropped link the count stopped at 2.The notices count whole polls instead.
useArmPollFailinginpages/settings/AboutPanelUpdateFlow.tsxreads two fields React Query keeps across fetches:errorUpdateCount(one more for each poll that failed after its retries) anddataUpdatedAt(renewed by every answer, the arm click's own write included). Any answer ends the run. Both notices use it, the armed in-app update and the request card inpages/settings/AboutPanel.tsx.Backwards compatibility
Compatible: only when the two notices show changes; their wording, the threshold and the retry policy are unchanged.
Reader: website/src/pages/settings/AboutPanel.tsx:AboutPanel -- crew page -- the only importer of
ARM_POLL_FAILURE_THRESHOLD, which is no longer exported; it callsuseArmPollFailinginsteadTests
AboutPanel.agentUpdateRequest.test.tsx,a poll that keeps failing is surfaced, and the card stays up: runs on the app's own client (newQueryClient(), retry delay shortened) with a 503, where it used aretry: 3client production does not have.AboutPanel.inAppApply.test.tsx,says the approval status is unreachable after three failed polls of a 503, not before: on the app's client,arm-poll-erroris absent after two failed polls of a 503 and present after the third.Proof: not provable -- frontend test (prove.py runs Python only)
Manual verification
Reproduced and smoke-tested on Ubuntu 24.04.5 LTS (Linux x86_64): the dashboard built from an earlier base (
d15505809e) and then with this change on it, served by an isolated gateway and driven with Playwright. Only/api/update/armwas intercepted, plus, for the armed in-app update, theupdate_*status fields that a git checkout reports as not armable.Recovery: with the notice up on the armed in-app update, the read was switched back to the live arm answer. The next poll answered, the notice was gone 0.3 s later, and the armed panel stayed.
Screenshots / video
Request card, every read answering 503, at the 90 s mark. Base, then this branch:
Armed in-app update, every read answering 503. Base at 90 s, then this branch, then after the gateway answers again:
The header's
d15505809ebadge names the gateway's own checkout. In the "this branch" shots the dashboard bundle is built from this branch's tree.Related Issues
Closes #37084
Sibling sweep
Swept: git grep -nE "failureCount >=|.failureCount\b" -- website/src
Sibling: website/src/pages/settings/AboutPanel.tsx -- changed here
Sibling: website/src/pages/settings/AboutPanelUpdateFlow.tsx -- changed here
Sibling: website/src/components/PullRequestPanel.tsx:132 -- not affected -- its threshold reads the panel's own failed-poll counter, not React Query's failureCount
Pattern harvest
Rule candidate: review-prompt
Pattern: a notice or gate that waits for React Query's
failureCountto pass the number of retries one fetch gets.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.