Skip to content

fix: keep retry controls when lazy recovery views fail - #180646

Merged
steipete merged 2 commits into
mainfrom
solid2/w-s2-lazy-error-boundaries
Oct 22, 2026
Merged

steipete merged 2 commits into
mainfrom
solid2/w-s2-lazy-error-boundaries

Conversation

@steipete

@steipete steipete commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes notifications and browser sign-in recovery losing their controls when a lazy UI chunk fails to download.

User Impact

The affected surface now offers Retry and dismissal after a load failure; sign-in remains available, and retry preserves the original notice or sign-in progress.

Why This Change Was Made

The two lazy renderers had loading boundaries but no local error boundary, so a rejected import halted their reactive render. Local Errored fallbacks keep the existing toast and sign-in owners authoritative. The original renderers remain lazy, and the toast fallback preserves hover/focus dismissal timing.

The small eager fallback markup adds 613 B gzip to startup. Both builds remain below the current strict 325,657 B limit, and no additional renderer or library enters startup. Keeping recovery available when a chunk fails requires the fallback to be available before that chunk loads.

Evidence

Proof Result
Two mounted-entry regression tests Both fail on the exact base with missing controls and REACTIVITY_HALTED; both pass with the fix
pnpm tsgo:ui Pass
Targeted oxlint, oxfmt, mock-exports guard, git diff --check Pass
Independent review No actionable findings
Base/head pnpm ui:build and strict performance check Pass; zero budget violations
Startup JS gzip / requests 316,759 B / 7 → 317,372 B / 7
Startup CSS gzip / requests 40,939 B / 1 → 40,939 B / 1
Production Knip Identical on exact base and head: only unused src/infra/heartbeat-active-hours.ts and src/infra/heartbeat-wake-policy.ts (exit 1); no new findings
Synthetic browser failure/retry capture Base loses controls; head contains both errors and successfully retries the actual lazy renderer

The baseline is f4e384450c45656b76ce9f8831117a5bd94b9bcc. Browser captures use only synthetic content and locally aborted module downloads.

Recipe counts in the two production files: Errored 0 → 2; Loading 2 → 2; action, optimistic state, affects, refresh, isPending, latest, async memos/projections, and inline error signals all 0 → 0. No outside loading reads or new lifecycle subscriptions were added.

Production LOC: 293 → 352 (+59 recovery markup). Test LOC: 0 → 95. No new state owner, abstraction, dependency, translation copy, or compatibility path.

CI correction and attribution

The first full CI run (39786500544) required explicit mock-isolation explanations for the two intentionally throwing lazy-module mocks. Commit b4bc21f7568 adds those comments; the mock-exports guard passes, and independent review found no actionable issue. Production behavior is unchanged from the tested head.

The same run failed Control UI session management mocked Gateway E2E > nests spawned sessions (personal pin: false) and (personal pin: true). Both reproduce on exact base f4e384450c4, timing out on the same first child “Active run” indicator. The focused baseline command is node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/session-management.sidebar.e2e.test.ts --maxWorkers=1 -t 'nests spawned sessions' (2 failures, 83.92s).

The forced-colors keyboard-focus case also failed in the first run but passed the focused exact-base and head checks. All three UI unit shards pass in replacement full run 39788863226, resolving it without a production change. Both real-Gateway shards pass. The complete job inventory has two failed root jobs: the two sidebar nesting cases listed above and Control UI Workboard routing > routes, pins, persists, and normalizes Workboard boards. The Workboard case also reproduces on exact base f4e384450c4, at line 156 waiting for the Workboard title after missing-board normalization (27.41 seconds, one case, one worker). Its test and route inputs match the actual CI baseline and merge. All other jobs passed or were skipped, including every UI unit and both real-Gateway shards.

The actual replacement CI checkout is merge aa2b856eb5250fbfa449eac8b8bace6eb60a621c, with parents 09ff7b2adcbc8cce1a11d664c7701d400086039e and b4bc21f7568adf657f59cdb1db78faf1f2e3b453. The sidebar E2E test and child-ordering source blobs match the reproduced exact base, that CI baseline, and the tested merge. Native replacement recovery retains these checkout/failure artifacts and performs the final full-inventory check.

Refactor checklist in the touched production files: controller hooks, effects, render effects, untrack, direct listeners, DOM queries, manual class strings, flush, owner APIs, and component onCleanup are all 0 → 0; onSettled is 1 → 1 and lazy is 2 → 2. No manual component loader was introduced.

Screenshots

Before/after images below show the two failed-download states at 900×650. Successful retry is also exercised in each capture and regression test.

Notification before: failed download leaves no controls

Notification after: retry and dismissal remain available

Sign-in before: failed download leaves no recovery controls

Sign-in after: retry, dismissal, and sign-in remain available

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T13:28:50.519330Z 8e2c3d9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8e2c3d99f6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<button class="btn" onClick={dismiss}>
{t("connection.browserSignIn.dismiss")}
</button>
<button class="btn" onClick={() => reset()}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Route stale module retries through the reload owner

When RecoveryDialog fails with the production dynamic-import errors caused by a Gateway update or module-fetch outage, this calls reset() and retries the same module URL. Chromium and WebKit can pin that failed import for the document, which is why stale-chunk-reload.ts routes other lazy surfaces through retryStaleChunkReloadWhenReachable; here the button can repeatedly return to the same error until the user manually reloads. The same omission exists in toast-host.tsx:38, while the new vi.doUnmock tests replace the loader and therefore do not exercise the browser module map. Classify error() and use the guarded reload owner before falling back to reset().

AGENTS.md reference: AGENTS.md:L79-L81

Useful? React with 👍 / 👎.

</openclaw-modal-dialog>
)}
>
<Loading>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Retain recovery controls while the retry is pending

When a retry remains pending—for example while the server restarts or a slow module request is in flight—reset() clears the Errored fallback and this Loading boundary renders nothing, so the browser-auth view loses Retry, Sign in, and Not now until the request settles; toast-host.tsx:52 similarly loses Retry and Dismiss. Existing lazy-dialog patterns observe the lazy child so the error fallback remains mounted during retry, but these tests immediately resolve after doUnmock and never hold the retry promise. Keep the recovery fallback visible throughout the pending attempt.

AGENTS.md reference: AGENTS.md:L79-L81

Useful? React with 👍 / 👎.

@steipete
steipete enabled auto-merge (squash) October 22, 2026 13:32
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 22, 2026
@steipete
steipete disabled auto-merge October 22, 2026 13:39
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR adds local error fallbacks with Retry, dismissal, and sign-in controls when notification or browser-authentication views fail to load.

Example: The browser sign-in dialog module fails to download while an existing conversation is open.

  • Before: The lazy render fails without recovery controls.
  • After: The dialog offers Not now, Retry, and Sign in while the existing recovery owner retains sign-in progress.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch has no established introduced defect; supplied proof is strongest at the mounted-owner and synthetic-browser boundaries.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; inspected synthetic browser captures show both fallback states, while successful retry is reported in the body and supported by mounted-owner tests rather than a supplied shipped-entry trace.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A failed lazy download removes notification or sign-in recovery controls from an otherwise open UI.
Reason: The maintainer-authored direction restores useful recovery actions with narrow changes and preserves the existing lazy-loading and ownership contracts.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR fixes a current recovery failure with focused error boundaries; no actionable introduced defect was established.

Priority: P2
Reviewed head: b4bc21f7568adf657f59cdb1db78faf1f2e3b453

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied screenshots show synthetic browser fixtures rather than a shipped Control UI trace of failed downloading followed by successful retry.
Agent review details

How this fits together

The Control UI's document-authentication and toast owners supply state and actions to lazy renderers; the new eager fallbacks present recovery controls without taking ownership of that state.

flowchart TD
  A[HTTP failure or notification] --> B[Existing recovery owner]
  B --> C[Lazy renderer]
  C --> D[Normal view]
  C --> E[Local error fallback]
  E --> F[Retry or owner action]
  F --> B
Loading

Technical review

Best possible solution:

Keep the two local fallbacks around the existing lazy renderers, preserving their current state, dismissal, authentication, and global reload owners.

Do we have a high-confidence way to reproduce the issue?

Current-main source shows both missing local error boundaries, and the supplied before/after browser fixtures illustrate the resulting missing controls; no target code was executed during this review.

Is this the best way to solve the issue?

Local error boundaries are the smallest complete containment fix: they retain lazy loading and reuse existing owners without adding state, dependencies, or a parallel recovery manager.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8e6990a1820f.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Verified PR scope: The pinned introduction diff changes only the two lazy renderer boundaries and their focused regression tests; base-only dashboard and other test changes are outside this PR. (b4bc21f7568a)
  • Current main still needs containment: Fetched main retains the original Loading-only boundaries in both production files, leaving rejected lazy imports without these local recovery controls. (ui/src/app/browser-auth-recovery.tsx:103, 8e6990a1820f)
  • Existing stale-chunk recovery remains active: The shipped entry point installs the global vite:preloadError listener, which schedules guarded recovery for caught lazy-surface import failures; its existing test covers that contract, so the earlier review's stale-chunk concern is not independently established as an introduced defect. (ui/src/app/stale-chunk-reload.ts:413, b4bc21f7568a)
  • Pinned retry semantics: Both changed modules import solid-js, pinned by ui/package.json to 2.0.0-rc.16. Read-only inspection of that published package and @solidjs/signals confirms reset recomputes failing sources and retains the error fallback while they remain pending, contradicting the earlier disappearing-controls finding. (b0ad1df505b8)
  • Inspected visual evidence: All four downloaded before/after screenshots were inspected: the synthetic notification and sign-in fixtures gain the stated recovery controls, and the images contain synthetic content. (b4bc21f7568a)
  • Feature history and original intent: History across browser-auth-recovery.ts and .tsx and toast-host.ts and .tsx identifies steipete as the principal feature author and migration contributor. refactor(ui): derive browser sign-in probe readiness #180049 introduced deferred sign-in rendering while retaining the document owner; refactor(ui): pair app and plugin teardown with Solid setup #179096 preserved lazy toast rendering and dismissal ownership. Some older blobs are unavailable locally, but the relevant current source and original PR explanations were readable. (ui/src/app/browser-auth-recovery.tsx:47, 8e6990a1820f)

Likely related people:

  • Peter Steinberger: Raw commit e074991 adds ui/src/app/browser-auth-recovery.ts:15 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e074991f0344; files: ui/src/app/browser-auth-recovery.ts)

PR surface

Source +59, Tests +95. Total +154 across 4 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 2 83 24 +59
Tests 2 95 0 +95
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 178 24 +154

Review metrics

Metric Value Why it matters
Production versus test growth Production +59 lines; tests +95 lines Production growth supplies eager recovery markup for two distinct lazy surfaces; each added test exercises failure and recovery through its existing production owner.

Labels

Label changes:

  • add P2: The change repairs controls lost after uncommon lazy-download failures in two Control UI surfaces.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The change repairs controls lost after uncommon lazy-download failures in two Control UI surfaces.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • A built Control UI capture showing a failed chunk, retained controls during retry, and successful recovery would strengthen behavior evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 22, 2026, 9:58 AM ET / 13:58 UTC.

@steipete
steipete merged commit 18596ee into main Oct 22, 2026
123 of 128 checks passed
@steipete
steipete deleted the solid2/w-s2-lazy-error-boundaries branch October 22, 2026 14:44
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui ci:full Keep ordinary native-locale CI selection on the next PR run. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant