Files
m4air 908db722f7 fix(crash-reporting): let a store-driven React #185 cascade name its own driver
React #185 crashes in v1.4.199 (reports 3efb42f1, 74dc8068) ship a crash
bundle with no `react_commit_cascade` breadcrumb at all, so triage falls
back to the boundary that happened to catch the throw — a bystander the
payload itself flags as unreliable.

The cascade observer only counted a commit when `root.pendingLanes` still
held SyncLane/InputContinuousLane/DefaultLane. Verified against react-dom
19.2.8: `onCommitFiberRoot` is invoked BEFORE
`0 !== (pendingEffectsLanes & 3) && flushPendingEffects()`, and React reads
`root.pendingLanes` for `nestedUpdateCount` only after. A store-subscription
loop schedules its re-render from a passive effect, so every commit samples
0 while React counts it and throws — measured: all 55 commits report 0.

Count re-entrancy beside the lanes: a commit that arrives before the stack
unwinds to a microtask checkpoint is inside React's own synchronous
`flushSyncWorkAcrossRoots_impl` loop. The crumb ships `evidence`
('lanes' | 'reentrant' | 'mixed') and `laneCommits` so a measurement is
never readable as an inference, and `pendingLanes` stays raw.

A run with no lane evidence is dropped at its span's microtask checkpoint,
which both bounds the inferred count to one synchronous span and stops
`cascadeRoot` pinning a root unmounted mid-span through an idle window.

This does not fix the loop. It makes the next occurrence name its driver.
2026-09-10 22:12:48 -07:00
..