Repository navigation
fix(crash-reporting): stamp React #185 boundary attribution as unreliable - #16153
Merged
Merged
Conversation
A triager opening a "Maximum update depth exceeded" (minified React #185) crash report sees a boundary_id and a component_stack that look like a precise culprit, and treats them as one. They aren't. React's nested-update counter is global to the root, not per fiber, so the invariant throws on whichever component happens to call setState next after the counter trips. The boundary that catches it is a bystander picked by commit order. The visible cost is misrouting: identical crashes fan out across many boundary_ids, so clustering the reports by boundary_id splits one bug into several phantom ones, and each one points at innocent code. The renderer now tags these reports with attribution: unreliable, and the formatted report prints the caveat above the details blob where it can't be scrolled past. Detection covers minified (#185), unminified, and errors/185 URL forms while rejecting #1850+. Wire compatibility: attribution is a new optional field. Old hosts ignore it; the host accepts only the one known verdict and drops anything else a newer renderer sends, so no report is rejected on version skew.
Contributor
|
Warning Review limit reachedNext included review available in 11 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
paidaxingyo666
pushed a commit
to paidaxingyo666/Manta
that referenced
this pull request
Aug 25, 2026
…s unreliable (stablyai#16153) (cherry picked from commit 0753f0a)
dallascrilley
pushed a commit
to dallascrilley/orca
that referenced
this pull request
Aug 27, 2026
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
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.
Description
boundary_idandcomponent_stackon a React #185 crash report name a bystander, not the component that is looping. This PR stamps those reports so triage stops clustering on a field that cannot carry that meaning.React 19.2.7's infinite-update detector is a module-global counter, not per-fiber state:
commitRootImpl(react-dom-client.development.js:18325-18332) incrementsnestedUpdateCountwhen a commit leaves sync-ish lanes (remainingLanes & 42) pending on the root — and Orca has one root. Otherwise it resets to 0.getRootForUpdatedFiber(:4619-4633) throws "Maximum update depth exceeded" once the counter passesNESTED_UPDATE_LIMIT(50,:27373). That function runs on everyenqueueConcurrentHookUpdate— i.e. on the nextsetStatefrom any fiber anywhere in the tree.So once one runaway commit-phase loop pushes the counter past 50, the throw is delivered to whichever fiber calls
setStatenext, and is caught by that fiber's nearest boundary. All eight #185 reports in the 1.4.188 batch begingetRootForUpdatedFiber → enqueueConcurrentHookUpdate → dispatchSetStateInternal → dispatchSetState. None of them shows the loop.This was demonstrated, not argued: a test that flips two sibling subtrees changes the reported
boundary_idwith nothing else about the bug changed.Why this matters
Triage has been clustering #185 by
boundary_idfor months. That produced the apparent "2 → 5 boundaries in 1.4.188" spread, which read as a regression — it isn't. Under a bystander model, going from ~2 samples to 8 predicts more distinct boundaries on its own, and no supporting code change was found (the boundary-id inventory, the victim components, and theuseLayoutEffect/flushSynccall-site count are all unchanged across the range).It also means prior narrowing — "SortableTab's own fiber", "the TerminalPane fiber" — named bystanders.
Fix evidence
Tests written first, implementation absent:
After — 31 files / 282 tests passed across the error boundaries,
react-error-boundary-reporting,crash-reporting(main + shared), and the crash-report UI.tscclean on bothtsconfig.node.jsonandtsconfig.web.json;oxlintzero warnings;oxfmt --checkclean.A #185 report now formats with the caveat above the Details block, so a Slack reader hits it first:
ELI5
A factory has one alarm that counts how many times work bounced back in a row. When the count hits 50 the alarm fires — but it fires at whoever touches a machine next, not at the machine causing the bounces.
We've been reading the alarm log as "this machine is broken" and sending engineers to five different machines. Those five were just whoever happened to reach for a lever at the wrong moment.
This change doesn't find the broken machine. It stamps the log with "this name is whoever was standing nearby — don't dispatch on it," so nobody spends another month investigating bystanders.
Trade-offs
boundary_idis deliberately left populated rather than nulled, for continuity with historical reports and existing dashboards. A reader who ignores the new caveat can still be misled — mitigated by putting the caveat above the Details block.Minified React error #185,errors/185,invariant=185(legacy decoder URL) and the dev text, with each numeric form guarded by(?!\d)so#1850/#1852/#18don't match and other React numbers (#310) never do. It reads the message offErrorinstances, bare strings, and any object with a stringmessage, so a non-Error throwable still classifies.docs/reference/remote-wire-compatibility.md): new optional field only.attribution?: 'unreliable'on the renderer→main IPC args plus two optional detail keys. Nothing removed or repurposed; absent degrades exactly to today's behavior. The main normalizer emitsattributiononly when the value is literally'unreliable', so a future renderer sending a different verdict degrades to no attribution rather than being trusted. The note text is main-generated from a shared constant, not trusted from the renderer, and goes throughsanitizeCrashReportDetailsunder the 240-char cap so it can't be truncated mid-sentence.max-linesdisable. Adding the formatter inline pushedcrash-reporting.tsto 314 counted lines (cap 300), so the caveat formatter was extracted tocrash-report-attribution-lines.ts, mirroring the existingcrash-report-signature-lines.ts.Adversarial review
Clean after 2 loops.
getRendererErrorReportKeystill keys dedupe onboundaryId(correct — dedupe should stay per-boundary even when attribution is unreliable);formatSummarystill asserts a React-render summary; and main accepts the renderer'sattributionwithout independent validation (bounded to the single literal'unreliable', and the note is main-generated).Perf
/perf: no meaningful impact, no changes applied. One regex on an already-fatal error path.Follow-up
The corrected search space for the actual driver: it must leave sync-ish lanes pending on every commit — layout effects, ref callbacks, render-phase
setState, and passive effects that write auseSyncExternalStore/zustand store (forceStoreRerenderschedules at SyncLane, andcommitRootImplflushes passive effects synchronously before samplingremainingLanes). That last case matters here: zustand v5 is used in 95 renderer files. Event/IPC-driven churn is excluded — each event's commit is its own settled turn.Related: #15736 (draft) would name the store slice writing on every commit.