fix(web): clear stale resource monitor errors after retry#24229
Problem
- After a failed resource monitor start, clicking Retry succeeds but the settings panel keeps showing the old error until the page is reloaded.
Change
- Refresh the telemetry query after a successful retry, and refresh the history in the diagnostics panel, so the stale error clears.
Scope and approval
- Small, focused fix of an obvious bug in retry state; no new capability or setting.
Verification
- Added
resourceTelemetryState.browser.test.tsx: after a successful retry, the hook's error clears. It fails without the change (expected 'The resource monitor is not available.' to be null) and passes with it. - Format, lint, knip, and typecheck pass for the affected packages.
- Not exercised in a running client.
Takeover
Keeps @yordis's original commit from #23970 and its two query refreshes. Replaced the mocked regression with rendered query-cache coverage; added an environment-guarded refresh for a history window selected while Retry is pending, after running-client evidence exposed that stale error. This origin branch replaces the non-pushable fork branch. The dispatcher owns closing the original and merging.
Evidence
Synthetic faults at the real server RPC boundary; real web UI, authentication, schemas, transport, query cache, and navigation. This proves client recovery, not native collector startup. Full matrix · captures, both diff variants, recordings, manifests, and rebuild recipe.
| Fixture | Proof |
|---|---|
| S0 diagnostics closed | Fixed synthetic workspace; light/dark, 1440/390 |
| S1 failed start | Distinct telemetry and history errors |
| S2 Retry pending | Explicit latch, disabled Retry, errors retained |
| S3 empty recovery | Both errors clear after success |
| S4 populated recovery | Metrics, history, process tree, and I/O recover |
| S5 Retry rejected | Errors retained; Retry available |
| S6 unavailable with retained data | Real successful reads transition to failures |
| S7 healthy control | Stable fixture; 25 icon pixels below threshold 16 disclosed |
| S8 diagnostics unavailable | Restricted connection omits panel |
| R1 recovery recording | Same document; before errors persist, after clear |
| R2 failure then success | Rejection toast, second Retry, visible recovered history |
| R3 history window switch | Selected 5m and originating 15m both recover |
| R4 environment switch | A Retry completes without changing B; focus away/back |
| R5 close/reopen | In-app navigation while pending; healthy reopen |
All still rows: before/after at 1440×1000 and 390×844, light/dark; 300 identical settling pairs, semantic crops and both zero×8/threshold16 diffs. Thirteen canonical narrated recordings; historical failed proof is explicitly marked.
Before: Before: successful Retry leaves the stale resource error
After: After: successful Retry clears the resource error
Before recording · After recording
Verification log
Final proof audit: SUFFICIENT; all S0–S8/R1–R5 objections resolved; independent fresh-home recovery reproduced. Final head: 5 tests passed across the browser regression and existing diagnostics logic file; targeted lint, formatting, web typecheck and diff checks passed. Regression removals reproduced the original and selected-window failures. Code review round 1: A+B MERGE. Running-client proof then exposed the window-switch case; fixed and reviewed again in round 2: A+B MERGE. CI: pending on the replacement head; monitored through T3 Code. Required changed surface: web. Responsive 390px is web; native collector startup, Electron shell, and native mobile were not exercised. No provider, contract, persistence, auth, permission, or MCP behavior changed. Contributor commit remains in ancestry; no fork write, force push, rebase, or merge of a PR. Model and harness: gpt-6.1-sol via Codex in T3 Code, including every delegated step.
Checks
- SuccessfulCodeRabbitGitHub
Review skipped
- Skipped
- Skipped
- Skipped
- SkippedRemove preview downloadGitHub
- Skipped
- Skipped
- SkippedRemove preview downloadGitHub
- Skipped
- Skipped
- Skipped
- Skipped
- SuccessfulRemove preview downloadGitHub
- SkippedBuild preview JS bundleGitHub
- SkippedDeploy web previewGitHub
- SkippedEAS PreviewGitHub
- SkippedBuild preview JS bundleGitHub
- SkippedDeploy web previewGitHub
- SkippedEAS PreviewGitHub
- SkippedDeploy web previewGitHub
- SkippedBuild preview JS bundleGitHub
- SkippedEAS PreviewGitHub
- SuccessfulCheckGitHub
- Skipped
- SkippedRustGitHub
- SkippedRelease SmokeGitHub
- SuccessfulTestGitHub
- SuccessfulTest WebGitHub
- SuccessfulBuild and TypecheckGitHub
- Skipped
- Skipped
- SuccessfulLabel PR sizeGitHub
- Skipped
- SuccessfulLabel PR 24229GitHub
- Successful
- Successful
- SuccessfulTest Server 7GitHub
- SuccessfulTest Server 6GitHub
- SuccessfulTest Server 8GitHub
- SuccessfulTest Server 4GitHub
- SuccessfulTest Server 5GitHub
- SuccessfulTest Server 2GitHub
- SuccessfulTest Server 3GitHub
- SuccessfulTest Server 1GitHub
- SuccessfulLintGitHub
- SuccessfulChangesGitHub
- SuccessfulPrepare PR size configGitHub
- SkippedEAS PreviewGitHub
- SuccessfulCollect PR targetsGitHub
- SuccessfulNative fingerprint diffGitHub
Added 5 commits
- merge: update resource retry takeover with main0b0e5e2
- fix(web): clear the stale resource monitor error after a successful retry7660c11
- fix(web): refresh selected resource history after retry7948385
- test(web): cover resource monitor retry recovery810d744
- merge: preserve yordis resource telemetry retry fixac82122
Approvability
Verdict: Approved at 0b0e5e2
Macroscope's review found this PR approvable — This is a focused web bug fix that refreshes telemetry and history queries after a successful resource-monitor retry, with guards for changed environments and history windows. The added browser tests cover successful recovery and preservation of errors on failed retries.
You can add or adjust custom eligibility rules. Learn more.