fix(web): clear stale resource monitor errors after retry#24229

merged5
main
takeover/pr-23970
opened2d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 1d ago

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.

FixtureProof
S0 diagnostics closedFixed synthetic workspace; light/dark, 1440/390
S1 failed startDistinct telemetry and history errors
S2 Retry pendingExplicit latch, disabled Retry, errors retained
S3 empty recoveryBoth errors clear after success
S4 populated recoveryMetrics, history, process tree, and I/O recover
S5 Retry rejectedErrors retained; Retry available
S6 unavailable with retained dataReal successful reads transition to failures
S7 healthy controlStable fixture; 25 icon pixels below threshold 16 disclosed
S8 diagnostics unavailableRestricted connection omits panel
R1 recovery recordingSame document; before errors persist, after clear
R2 failure then successRejection toast, second Retry, visible recovered history
R3 history window switchSelected 5m and originating 15m both recover
R4 environment switchA Retry completes without changing B; focus away/back
R5 close/reopenIn-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

All checks passed

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
Synced from GitHub

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.