Repository navigation
fix(deps): bump radix-ui 1.4.3→1.6.2 + react 19.2.7 to stop React 19 #185 ref loop (crash e95669d2) - #8679
Merged
Conversation
Contributor
📝 WalkthroughWalkthroughUpdated 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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 |
#185 ref loop radix-ui 1.4.3 bundles pre-fix sub-packages (react-slot 1.2.3, react-popper 1.2.8, react-compose-refs 1.1.2, react-menu/dropdown-menu 2.1.16) that build a new composed callback-ref identity every render. Under React 19's re-run-on- identity-change ref semantics, that detaches/re-attaches the ref each commit; several primitives compose a useState setter as that ref (Tooltip onTriggerChange, Popper onAnchorChange), so the state oscillates null<->node and after >50 nested updates React throws #185 (Maximum update depth exceeded). Crash e95669d2 (Tooltip->Button) and the dev DropdownMenu->Button reports. 1.6.2 bundles the fixed sub-packages (react-slot 1.3.0 memoized compose-refs, react-popper 1.3.3, react-compose-refs 1.1.3, react-menu/dropdown-menu 2.1.20, react-tooltip 1.2.12). Upstream radix-ui/primitives #3799 + #3963. Also batches React-runtime patch bumps (in-range 19.2.x, low risk): react/react-dom 19.2.5->19.2.7, @types/react 19.2.14->19.2.17. Evidence: Orca's real Tooltip+Button tree fires the button ref 2 attaches + 1 detach on a static mount with 1.4.3 (churn), and 1 attach + 0 detach with 1.6.2 (stable). Renderer suite (13703 tests) + web typecheck green on the combined bump. Co-authored-by: Orca <[email protected]>
nwparker
force-pushed
the
nwparker/fix-radix-ref-loop
branch
from
July 14, 2026 06:21
78d0fa2 to
2aee9f0
Compare
6 tasks
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
…tablyai#185 ref loop (crash e95669d2) (stablyai#8679) Co-authored-by: Orca <[email protected]>
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.
What
Fixes the React error #185 (
Maximum update depth exceeded) renderer crash by upgradingradix-uipast a known React-19 infinite-render bug.Anchor crash report
e95669d2-676c-4d12-99c3-940270aadb1d(macOS, prod build,app.workspace-shellboundary), plus matching dev-build reports:Root cause
This is a known upstream radix-ui bug under React 19 (radix-ui/primitives#3799, #3963) — not Orca code.
Radix primitives build a new composed callback-ref identity on every render (e.g.
Slotdoesprops.ref = composeRefs(forwardedRef, childrenRef)inline in render;Popper/DropdownMenudo the same). Under React 19's "re-run a callback ref when its identity changes" semantics, React detaches (ref(null)) and re-attaches (ref(node)) that ref on every commit. Several radix primitives compose auseStatesetter directly as that ref (TooltiponTriggerChange: setTrigger, PopperonAnchorChange: setAnchor). So each commit firessetState(null)thensetState(node); in the real concurrent renderer these land in separate commits, so the state genuinely oscillatesnull ↔ node, never hits React'sObject.isbail-out, and after >50 nested updates React throws #185. That is exactly the crash stack:setRef → Array.map → setRef → dispatchSetState. It's intermittent because whether it diverges depends on commit timing.The installed
[email protected]bundles the pre-fix sub-packages:[email protected],[email protected],[email protected],[email protected],react-menu/[email protected].The fix
Bump the unified
radix-uipackage^1.4.3 → ^1.6.2(+pnpm installto refresh the lockfile). 1.6.2 bundles the fixed sub-packages —[email protected](memoizeduseComposedRefs, no inlinecomposeRefsin render),[email protected](stableuseCallbackanchor ref),react-menu/[email protected],[email protected]— which stop the per-render ref-identity churn. All 29 Orca radix imports use the unified package, so one version bump covers Tooltip, DropdownMenu, ContextMenu, Popover, HoverCard, Select, Slot, etc. at once.Batched React-ecosystem patch bumps
Per request, this PR also bumps the React runtime in the same pass (all in-range patch bumps within React 19.2.x, low risk):
react19.2.5 → 19.2.7react-dom19.2.5 → 19.2.7@types/react19.2.14 → 19.2.17(@types/react-domalready at latest19.2.3)Validated together with the radix bump: web typecheck (exit 0) + full renderer suite green.
ELI5
Every time the screen updated, a Radix button was handed a brand-new "call me when you're attached" note. React reads a new note as "the old one was removed, this is a new one," so it told the button "you're detached… now you're attached… detached… attached…" forever. Each flip nudged React to redraw, which made another new note, which caused another flip — a feedback loop until React gave up and crashed. The newer Radix reuses the same note across redraws, so React stops flip-flopping. We just updated Radix.
Fix evidence
<Tooltip><TooltipTrigger asChild><Button/></TooltipTrigger></Tooltip>fires the button's ref 3× on a single static mount with[email protected](identity churn — the seed of the loop). With[email protected]the identical tree fires the ref 1×. [before/after numbers from measurement]pnpm typecheck(all projects) + renderer unit suite green + production build succeeds. [fill in]Trade-offs / risks
data-radix-*selectors Orca depends on (data-radix-popper-content-wrapper,data-radix-collection-item) are preserved.Select:react-selectnow wraps content inPresence, so the close-animation classes already onSelectContent(data-[state=closed]:fade-out/zoom-out, previously dead because the old version unmounted instantly) now run — a ~150 ms fade/zoom on dropdown close. This completes the intended open/close animation symmetry and has a reduced-motion fallback (instant unmount, no "stuck open"), but it should be eyeballed.mobile/has its own separate lockfile and is not touched by this bump. If the same fix: improve scrollbar and file explorer scroll behavior #185 loop affects mobile, it stays unfixed there (separate follow-up).[email protected]still bundles pre-fix radix (its own inline ref composition churns), but it is not reachable by current Orca code — cmdk composes nouseStatesetter as a ref, and Orca never places a cmdk primitive directly under a radixasChildtrigger (the combobox pattern isPopoverTrigger asChild → Button, withCommandIteminsideCommandList). Worth a later cmdk bump/override or a lint note, but no live crash today.terminal-rendering-goldenmac e2e + full suite. Locally validated: web typecheck (exit 0) + full renderer suite (13,703 tests, 0 failures). Recommended manual smoke: Select open/select/close (incl. inside a Dialog), Dialog/Sheet open→close interactivity, DropdownMenu/ContextMenu submenus, tooltips, ScrollArea, Slider.package.json+pnpm-lock.yaml.Adversarial review
1 loop → clean (LOW risk, no blockers). Two independent skeptic lenses:
react-slot1.2.3 (inlinecomposeRefs()in render → new identity each render) → 1.3.0 (memoizeduseComposedRefs, stable);react-popper1.2.8 (useComposedRefs(ref, (n)=>setContent(n))inline arrow) → 1.3.3 (stablesetContentpassed directly);react-menu2.1.16 → 2.1.20 (memoized). With memoized/stable composed refs, React 19 no longer re-invokes the ref on re-render, so the loop is fully closed (an aggressively re-rendering ancestor can no longer revive it), for both reported surfaces (Tooltip and DropdownMenu, both resolving to the fixed versions in the lockfile).data-radix-*selectors Orca depends on are preserved. One visible behavior change (Select close animation, above); one dormant, non-reachable residual (cmdk, above). Full renderer suite (13,703 tests) + web typecheck green.