AppErrorBoundary: report render crashes through reportError with a refId - #309
Merged
Conversation
…-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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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:componentDidCatchonly logged through the bare@corbits/client-loggetLoggercall — never throughreportError(@corbits/error-sink) — so any render crash it does catch in production carries norefIdand never reaches the structured error-reporting sink. A person hitting the boundary has nothing to quote back to support.This PR wires
componentDidCatchthroughreportError, stores the returnedrefIdin state, and shows it under the fallback message the same way the onboarding page's own error states already do (Reference: {refId}).Testing
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.