Repository navigation
fix: hold root.render transitions that suspend into a held boundary - #2283
Conversation
A root.render request rendered at transition priority now drops its whole root transaction when it suspends into a boundary holding committed content, as hook-driven transitions already do. Each holding boundary keeps the request (by owner generation) and retries it at transition priority when its data settles, its timeout fallback shows, or a new update wakes it. A later request or its commit replaces the held one. useSyncExternalStore journals its render-time getSnapshot write, so a dropped render restores the selector the held screen still shows and a store notification updates that screen instead of consulting the pending selector. Fixes #1341. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website-mcp | 2023fba | Commit Preview URL Branch Preview URL |
Oct 29 2026, 11:10 AM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website | 2023fba | Commit Preview URL Branch Preview URL |
Oct 29 2026, 11:10 AM |
Benchmark report
Compares js-framework: 1k/10k row operationsAll 20 timed operations (20 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)
51 other measured values are unchanged. Public-import reachability bundles (bytes)
95 other measured values are unchanged. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Request-only holds skip origin replay
- Initialized
firsttorequest && batches.length === 0so a request-only dropTransitionRender passesall=trueto renderDroppedTransaction, replaying all drain origins instead of only urgent ones.
- Initialized
Or push these changes by commenting:
@cursor push 9f95d3e476
Preview (9f95d3e476)
diff --git a/packages/octane/src/runtime/transitions.ts b/packages/octane/src/runtime/transitions.ts
--- a/packages/octane/src/runtime/transitions.ts
+++ b/packages/octane/src/runtime/transitions.ts
@@ -733,7 +733,7 @@
__profileCount(ProfileCounter.ROLLBACK_TRANSITION);
if (TRANSITION_HARVEST !== null)
for (let i = 0; i < TRANSITION_HARVEST.length; i++) TRANSITION_HARVEST[i].taken = false;
- let first = false;
+ let first = request && batches.length === 0;
for (const batch of batches) {
if (!batch.held) first = batch.held = true;
}You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 13d07f4. Configure here.
The root's render skips a memoized counter, which renders its own transition update in the drain that drops the held root.render request. A drain renders each wave shallow-first, so that update renders after the drop, in a fresh transaction, and commits; the test fails if the drop left later origins in the dropped transaction. Co-Authored-By: Claude Opus 5.5 <[email protected]>


Summary
Fixes #1341.
startTransition(() => root.render(App, next))that suspends into a@tryshowing committed content now holds the whole screen, the way a hook-driven transition already does. AuseSyncExternalStorenotification during the hold now updates the selection that is still on screen.Why
The issue's follow-up comment found two causes:
useSyncExternalStorewroteinst.getSnapshot = getSnapshotduring render without journaling it. When the boundary held, the store cell kept the pending selector (b), socheckStoreChangedcompared the committed value againstb's value and dropped the notification.root.rendertransition folds no hook work, sodropTransitionRenderreturned false. The boundary held on its own and the root's new props committed early. The re-render that the notification forced then readk: 'b'and showed@pending.Fixing only the first cause swaps the stale value for a loading flash, so both changes ship together.
Changes
useSyncExternalStorejournals the selector write when its identity changes. A dropped render restores the selector the held screen shows.dropTransitionRenderalso drops the transaction when the drained origin applied its root's request at transition priority. Each holding boundary records that request by owner generation (TransitionHold.request).retryRootRequest). Inside a render or flush, the retry waits for the transition task, asretryTransitionBatchdoes. This happens when its data settles, when its timeout fallback shows (unsuspendTransitionHolder), or when a new update wakes it.root.renderor the request's own commit bumps the generation. A stale hold then retries nothing, and the boundary resumes on its own path.holdsUnrenderedTransitionkeeps the hold through renders that did not render the root request, such as the urgent store re-render.SUSPENSE_DIVERGENCE.md§4 and the runtime comments now sayroot.rendertransitions are covered. Transitions with no queued work at all remain per boundary.Validation
pnpm format:check: not run repo-wide;pnpm format:files:checkpasses on every changed file.pnpm typecheck: not run repo-wide;pnpm typecheck:filespasses onengine.ts,transitions.tsand the fixture. The test file shows two existingTS4111process.env.NODE_ENVerrors, on lines already inmain.pnpm test: not run locally; CI runs it.Targeted tests,
octaneproject, all passing: 49 files and 1,419 tests across transition*, suspense*, root-, behavior-root, sync/external store, and conformance entangled-commit, parallel-transitions, fuzz-suspense, suspense-, transitions-extra, view-transition, sync-store-tearing. Also the differential transition-swap* and suspense-timing tests.external-store-behavior.test.tsalso passes underoctane-prod.New regression tests in
external-store-behavior.test.ts, under "a root.render transition that suspends into a held boundary":keeps the store selection of the screen it holds live(the issue's repro, plus a label outside the boundary) fails onmain.keeps holding when the retried request suspends againfails onmain.lets a later urgent root.render replace the held requestpasses on both. It guards against a retry reviving the replaced request.perf-review:node scripts/perf-review-scan.mjsreports no candidates. The one hot-path change is in theuseSyncExternalStoreupdate path: ajournalRootPropertycall when the selector identity changes. Same-session A/B withnode benchmarks/external-store-fanout/run.mjs octane-tsrx 8, which uses 512 inline-selector subscribers, so the entry fires on every subscriber render:The update ops are flat. Mount runs unchanged code, and its run-to-run spread is wider than the base-to-branch gap. Everything else runs only while a transition hold exists.
TransitionHoldkeeps a single allocation site with one key set.concise-code: src +115 −24 (runtime +115 −24), comments included. One new runtime export,retryRootRequest, called fromtransitions.ts.suspendingTransitionHoldis now exported, replacing a one-lineholdRootRequestwrapper. No new files apart from the changeset.TransitionActionBatch. It would need fold and pending-hook semantics a root request does not have, and re-armingowner.requestwould let an urgent root render apply it.root.render(keepTransition) and commit (the request's generation bump) already treat an owner hold as held hook work, so reusing it would change their behavior for hook transitions.node benchmarks/bundle-size/run-minimal.mjsbase vs branch:suspense-transition,split-shell*,descriptor-children,binding-{radix,base-ui,apollo-client}).signal-*,hydrate-frameanddeferred-hydration.binding-hooks, which is the selector journal.CI benchmark report on
2f5b7fc0:shell_js+723 raw / +201 gzip andbindings_fw+754 raw / +225 gzip.addat +6.4% (95% CI +3.0% … +12.2%). That operation reaches nouseSyncExternalStore, transition or hold code; octane-tsrxaddis ±0.0% and every other operation is within noise. I read it as code layout or runner noise, not a cost of this change.Risk / follow-ups
useTransition'sstart(() => root.render(...))still raises noisPendingfor the held request; a root request has no batch for a hook to count. That was true before this change.root.renderrequest at urgent priority. That is how root requests already queue (owner.request) and is unchanged here.Provenance
agent-authored)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Note
Medium Risk
Changes Suspense transition commit, root render queuing, and the useSyncExternalStore update path; behavior is narrow but sits on critical render/commit infrastructure.
Overview
startTransition(() => root.render(...))that suspends while a@tryboundary still shows committed content now drops the whole root transaction and keeps the previous screen—including props outside the boundary—until the held request retries, matching hook-driven transition holds (#1341).The runtime records the suspended
root.rendergeneration on eachTransitionHold, retries it viaretryRootRequestwhen the boundary releases, and treats a newerroot.renderor commit as superseding the hold.dropTransitionRender,holdsUnrenderedTransition, and transition-task scheduling were extended for root requests alongside existing batch holds.useSyncExternalStorenow journalsgetSnapshotidentity changes during update so a dropped transition render restores the selector the committed UI still uses; store notifications during the hold update the visible selection in place instead of reading the pending tree’s selector or flashing@pending.Docs in
SUSPENSE_DIVERGENCE.mdand runtime comments note thatroot.rendertransitions share the whole-screen hold behavior. NewHeldSelectionBoundaryregression tests cover live store updates while held, double suspend on retry, coexisting hook transitions, and urgent superseding renders.Reviewed by Cursor Bugbot for commit 2023fba. Bugbot is set up for automated code reviews on this repo. Configure here.