Skip to content

AppErrorBoundary: report render crashes through reportError with a refId - #309

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-6632-onboarding-crash
Aug 22, 2026
Merged

AppErrorBoundary: report render crashes through reportError with a refId#309
TheGreatAxios merged 2 commits into
mainfrom
cl-6632-onboarding-crash

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

CL-6632

Owner-reported: adding a provider key during onboarding was seen crashing to the React error boundary ("This screen hit a snag").

What I found

Extensive live repro attempts against a fresh signup did not reproduce the render crash itself:

  • Anthropic radio (default) with a fake key, from onboarding — connects (onboarding stores immediately, no live probe — CL-6123) and navigates home cleanly.
  • Ollama radio with a real tailscale URL, from onboarding — connects cleanly.
  • "Skip for now" from onboarding — lands home cleanly.
  • Adding an Anthropic key from Settings → AI providers (which does live-probe) — surfaces "API key is invalid." in the dialog, no crash.

I could not find a render-time hazard in onboarding-page.tsx, onboarding.ts, or the credential-test probe logic that would explain the boundary firing, and could not force a repro. Filing this honestly rather than guessing at a fix for the crash itself.

What I did fix

While reading AppErrorBoundary (apps/web/src/app-error-boundary.tsx), I confirmed the ticket's third ask was a real, standing gap regardless of the specific trigger: componentDidCatch only logged through the bare @corbits/client-log getLogger call — never through reportError (@corbits/error-sink) — so any render crash it does catch in production carries no refId and never reaches the structured error-reporting sink. A person hitting the boundary has nothing to quote back to support.

This PR wires componentDidCatch through reportError, stores the returned refId in state, and shows it under the fallback message the same way the onboarding page's own error states already do (Reference: {refId}).

Testing

  • Added a test asserting the boundary's fallback shows a quotable Reference: <refId> string after a caught render error.
  • bun test test/app-error-boundary.test.tsx — 3/3 pass.
  • WORKBENCH_CHECK_SINCE=origin/main bun run typecheck — clean.
  • WORKBENCH_CHECK_SINCE=origin/main bun run lint — clean (pre-existing warnings elsewhere untouched).

Follow-up

The underlying render-crash repro remains open. Worth a repro pass with real browser devtools attached (not just agent-browser's a11y snapshot, which won't show a crash that self-recovers or a race that agent-browser's timing missed) directly against the owner's demo path, or a screen recording from the original report.

…-6632)

A render crash the boundary catches never reached a sink and showed no
refId — undiagnosable in production. Routes componentDidCatch through
@corbits/error-sink instead of the bare client-log call, and shows the
returned refId in the fallback so a person can quote it back.
@TheGreatAxios
TheGreatAxios merged commit feae8f1 into main Aug 22, 2026
5 checks passed
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.

1 participant