Skip to content

fix(octane): publish resumed hydration events on acceptance - #2193

Merged
trueadm merged 4 commits into
octanejs:mainfrom
openai-oss-forks:fix/accepted-hydration-events
Oct 21, 2026
Merged

trueadm merged 4 commits into
octanejs:mainfrom
openai-oss-forks:fix/accepted-hydration-events

Conversation

@domgan-oai

@domgan-oai domgan-oai commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

When a suspended hydration arm resumes during an event and then suspends again or is discarded, handlers written during that speculative attempt can receive the in-flight event. Stage resumed-arm event authority with the capture and publish surviving handlers at root acceptance, before mutation callbacks. Native custom-element listeners retain their original callback identity; repeated writes publish only the final surviving value.

A parked reveal forwards its staged handlers to the root. If native registration then fails, recover the affected arm and retry the exact restored reveal without reviving an already released transition hold or clearing another root's pending state. When a sibling releases a ready boundary inside an active same-root transaction, journal the parked slot and its actions before consuming the reveal.

Validation

  • pnpm format:check on the implementation commit; scoped formatting passed on the final feedback fix.
  • pnpm typecheck — full workspace typecheck could not complete with the filtered local install. Production-source scoped typecheck passed; selecting the new test also reports two pre-existing exact-optional-property errors in tests/_server-fixture.ts, unchanged from the upstream base.
  • pnpm test — the full command stopped in the Visx declaration precheck before Vitest; the filtered local install was required because an unrelated workspace tarball returned HTTP 403.
  • 396 targeted tests across 13 hydration, event, render-phase, and recovery files on the final feedback fix. The first parked-reveal matrix passed 6/6 before this PR, 2/6 at an earlier PR head, 4/6 with the first recovery candidate, and 6/6 after correction; it covers development and production builds, listener delivery, native-registration recovery, and a separate root's pending optimistic state. A second same-root matrix passed both ordinary controls but failed both registration-recovery cases at 1b7ceccdf; all four passed after journaling the nested reveal.
  • Render-writer audit, runtime split check, and full hydration-free reachability gate; pnpm sync passed before publication.
  • Current-head CI passed at a9e731528; the Chromium job passed on one targeted rerun after the first attempt timed out in an unrelated fixture setup.

At a9e731528, matched complete Vite/Oxc executable bundle gzip deltas versus upstream 119f1059fa508a44751fcb0aee6f7e7e2741a134: root-static +78 B, prop-attributes +87 B, hydrate-root +1,075 B, suspense-transition +197 B; all eight executable checks passed. In synthetic Chromium cohorts with 128 handlers, median synchronous resumed hydration increased from 20.0 to 76.7 microseconds for delegated handlers (paired ratio 3.82, 95% interval 3.64–4.00) and from 40.0 to 55.0 microseconds for native custom-element handlers (1.42, 1.32–1.55). Ordinary-mount medians matched, no-listener controls showed no clear difference, and identity and delivery checks passed. These success-path measurements exclude setup and paint; they do not time registration failure or parked-reveal recovery and do not establish application latency.

Risk / follow-ups

Deferring native registration can change listener order relative to third-party registrations during render, including stopImmediatePropagation behavior, and shifts registration errors to acceptance. Superseded transient registrations no longer run their host-side effects. The design preserves native callback identity and external deduplication; it does not promise general atomic rollback of arbitrary host operations. Hosts whose internal event slots cannot be safely staged retain the existing immediate-write behavior. The measured resumed-handler overhead is material in relative terms, and the final recovery code adds a small common-path bundle cost; both need maintainer judgment. This change does not address retention across changed forwarded inputs.

Provenance

  • An agent produced this diff (agent-authored)

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Note

High Risk
Touches hydration commit ordering, event handler publication, and custom-element listener registration—security- and behavior-sensitive paths where registration timing and failure recovery can change listener order and error surfacing.

Overview
Fixes a hydration bug where speculative resumed arms could install event handlers that still ran for an in-flight DOM event, even when that attempt was later suspended again or discarded.

During resumed suspense hydration, delegated handlers, $$signalOwner, and custom-element on* listeners are staged on the offscreen capture (hostEvents) instead of going live immediately. acceptHydrationHostEvents publishes them at root acceptance, before mutation-phase commit work, with journal undo and arm-level recovery when native registration throws. Discarded captures drop staged host events; splicing merges them into enclosing work like other capture queues.

Custom-element listener setup moves to setCustomElementListener; deferred registration can run after third-party listeners added during render (documented in the changeset). evt* paths route through setEventHandler when recovery is active so bundles are not written directly during speculative render.

Adds focused hydration tests for in-flight delivery, discarded listeners, native identity/dedup, render-phase listener swaps, registration failure recovery, and independent earlier-arm commits.

Reviewed by Cursor Bugbot for commit 57cb302. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent fix PR: bug fix labels Oct 21, 2026
@domgan-oai
domgan-oai marked this pull request as ready for review October 21, 2026 08:02

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark report

  • 🔴 bundle-size: 72 value(s) increased
  • 🔴 bundle-reachability: 84 value(s) increased

Compares 119f1059f, the merge commit's first parent with 2a4aa0b02 on the same runner. Any increase in a js-framework work counter fails this check; byte changes are a report. Wall time is a report: base and head samples alternate in one browser, and an operation is called slower or faster only when the 95% confidence interval of its ratio excludes ±3%. Workflow run

js-framework: 1k/10k row operations

All 20 timed operations (20 without a verdict)
target operation base ms head ms head/base 95% CI
octane-tsrx run 3.067 3.075 ±0.0% −3.5% … +7.0% ⚪ within noise
octane-tsrx replace 6.167 6.108 −2.4% −9.2% … +2.4% ⚪ within noise
octane-tsrx add 2.567 2.458 −1.9% −7.5% … ±0.0% ⚪ within noise
octane-tsrx update 0.093 0.091 −1.5% −3.3% … +0.3% ⚪ within noise
octane-tsrx select 0.006 0.006 ±0.0% −0.8% … +1.7% ⚪ within noise
octane-tsrx swap 0.019 0.019 +1.9% ±0.0% … +3.8% ⚪ within noise
octane-tsrx remove 0.016 0.016 −0.4% −2.0% … +1.6% ⚪ within noise
octane-tsrx runlots 22.867 24.000 +1.6% −2.0% … +3.1% ⚪ within noise
octane-tsrx select_lots 0.006 0.006 +0.6% −0.9% … +2.2% ⚪ within noise
octane-tsrx clear 49.700 49.042 −1.6% −3.5% … +3.7% ⚪ within noise
octane-jsx run 3.883 3.892 ±0.0% −2.6% … +3.9% ⚪ within noise
octane-jsx replace 7.158 7.000 −2.0% −5.1% … +1.1% ⚪ within noise
octane-jsx add 3.392 3.383 −2.9% −6.0% … ±0.0% ⚪ within noise
octane-jsx update 0.191 0.199 +1.1% −1.4% … +3.6% ⚪ within noise
octane-jsx select 0.100 0.104 +0.8% −2.6% … +4.4% ⚪ within noise
octane-jsx swap 0.149 0.155 −1.2% −1.8% … −0.0% ⚪ within noise
octane-jsx remove 0.137 0.142 ±0.0% −2.3% … +2.1% ⚪ within noise
octane-jsx runlots 32.825 30.775 −2.0% −6.0% … +1.2% ⚪ within noise
octane-jsx select_lots 1.131 1.118 +1.1% −2.2% … +3.5% ⚪ within noise
octane-jsx clear 52.183 57.525 +7.7% +1.8% … +11.2% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

target metric base head Δ
octane-tsrx js_raw 85,300 85,559 +259 (+0.3%) 🔴
octane-tsrx js_gzip 28,805 28,891 +86 (+0.3%) 🔴
octane-tsrx js_brotli 26,035 26,116 +81 (+0.3%) 🔴
octane-tsrx app_brotli 2,270 2,268 −2 (−0.1%) 🟢
octane-tsrx fw_raw 77,750 78,009 +259 (+0.3%) 🔴
octane-tsrx fw_gzip 26,189 26,275 +86 (+0.3%) 🔴
octane-tsrx fw_brotli 23,765 23,848 +83 (+0.3%) 🔴
octane-tsrx todo_js_raw 98,143 98,402 +259 (+0.3%) 🔴
octane-tsrx todo_js_gzip 33,474 33,561 +87 (+0.3%) 🔴
octane-tsrx todo_js_brotli 29,990 30,079 +89 (+0.3%) 🔴
octane-tsrx todo_fw_raw 91,958 92,217 +259 (+0.3%) 🔴
octane-tsrx todo_fw_gzip 30,700 30,787 +87 (+0.3%) 🔴
octane-tsrx todo_fw_brotli 27,652 27,741 +89 (+0.3%) 🔴
octane-tsrx chat_js_raw 96,952 97,211 +259 (+0.3%) 🔴
octane-tsrx chat_js_gzip 33,191 33,276 +85 (+0.3%) 🔴
octane-tsrx chat_js_brotli 29,828 29,891 +63 (+0.2%) 🔴
octane-tsrx chat_app_gzip 3,211 3,212 +1 (+0.0%) 🔴
octane-tsrx chat_fw_raw 89,820 90,079 +259 (+0.3%) 🔴
octane-tsrx chat_fw_gzip 29,980 30,064 +84 (+0.3%) 🔴
octane-tsrx chat_fw_brotli 27,026 27,089 +63 (+0.2%) 🔴
octane-tsrx weather_js_raw 135,188 135,447 +259 (+0.2%) 🔴
octane-tsrx weather_js_gzip 45,001 45,089 +88 (+0.2%) 🔴
octane-tsrx weather_js_brotli 39,955 40,032 +77 (+0.2%) 🔴
octane-tsrx weather_app_gzip 8,626 8,627 +1 (+0.0%) 🔴
octane-tsrx weather_fw_raw 110,118 110,377 +259 (+0.2%) 🔴
octane-tsrx weather_fw_gzip 36,375 36,462 +87 (+0.2%) 🔴
octane-tsrx weather_fw_brotli 32,666 32,743 +77 (+0.2%) 🔴
octane-tsrx bindings_js_raw 692,346 692,656 +310 (+0.0%) 🔴
octane-tsrx bindings_js_gzip 228,899 228,973 +74 (+0.0%) 🔴
octane-tsrx bindings_js_brotli 195,127 195,091 −36 (−0.0%) 🟢
octane-tsrx bindings_app_gzip 119,259 119,258 −1 (−0.0%) 🟢
octane-tsrx bindings_app_brotli 99,161 99,007 −154 (−0.2%) 🟢
octane-tsrx bindings_fw_raw 331,354 331,664 +310 (+0.1%) 🔴
octane-tsrx bindings_fw_gzip 109,640 109,715 +75 (+0.1%) 🔴
octane-tsrx bindings_fw_brotli 95,966 96,084 +118 (+0.1%) 🔴
octane-tsrx wayfinder_js_raw 442,486 446,659 +4,173 (+0.9%) 🔴
octane-tsrx wayfinder_js_gzip 146,103 147,307 +1,204 (+0.8%) 🔴
octane-tsrx wayfinder_js_brotli 127,639 128,676 +1,037 (+0.8%) 🔴
octane-tsrx threadline_oxc_js_raw 152,508 152,767 +259 (+0.2%) 🔴
octane-tsrx threadline_oxc_js_gzip 50,419 50,507 +88 (+0.2%) 🔴
octane-tsrx threadline_oxc_js_brotli 44,427 44,499 +72 (+0.2%) 🔴
octane-tsrx threadline_esbuild_js_raw 178,173 178,718 +545 (+0.3%) 🔴
octane-tsrx threadline_esbuild_js_gzip 59,707 59,889 +182 (+0.3%) 🔴
octane-tsrx threadline_esbuild_js_brotli 52,466 52,734 +268 (+0.5%) 🔴
octane-tsrx pagecraft_oxc_js_raw 545,161 545,865 +704 (+0.1%) 🔴
octane-tsrx pagecraft_oxc_js_gzip 171,575 171,768 +193 (+0.1%) 🔴
octane-tsrx pagecraft_oxc_js_brotli 145,666 145,818 +152 (+0.1%) 🔴
octane-tsrx pagecraft_esbuild_js_raw 577,922 578,999 +1,077 (+0.2%) 🔴
octane-tsrx pagecraft_esbuild_js_gzip 187,003 187,311 +308 (+0.2%) 🔴
octane-tsrx pagecraft_esbuild_js_brotli 159,020 159,338 +318 (+0.2%) 🔴
octane-tsrx full_fw_raw 532,454 536,693 +4,239 (+0.8%) 🔴
octane-tsrx full_fw_gzip 166,706 167,898 +1,192 (+0.7%) 🔴
octane-tsrx full_fw_brotli 141,845 142,829 +984 (+0.7%) 🔴
octane-jsx js_raw 162,552 162,862 +310 (+0.2%) 🔴
octane-jsx js_gzip 53,105 53,222 +117 (+0.2%) 🔴
octane-jsx js_brotli 46,886 47,024 +138 (+0.3%) 🔴
octane-jsx app_gzip 3,583 3,581 −2 (−0.1%) 🟢
octane-jsx app_brotli 2,920 2,922 +2 (+0.1%) 🔴
octane-jsx fw_raw 151,499 151,809 +310 (+0.2%) 🔴
octane-jsx fw_gzip 49,522 49,641 +119 (+0.2%) 🔴
octane-jsx fw_brotli 43,966 44,102 +136 (+0.3%) 🔴
octane-jsx shell_js_raw 331,900 335,941 +4,041 (+1.2%) 🔴
octane-jsx shell_js_gzip 108,278 109,442 +1,164 (+1.1%) 🔴
octane-jsx shell_js_brotli 94,018 94,980 +962 (+1.0%) 🔴
octane-jsx shell_app_gzip 767 768 +1 (+0.1%) 🔴
octane-jsx shell_app_brotli 663 655 −8 (−1.2%) 🟢
octane-jsx shell_fw_raw 330,807 334,848 +4,041 (+1.2%) 🔴
octane-jsx shell_fw_gzip 107,511 108,674 +1,163 (+1.1%) 🔴
octane-jsx shell_fw_brotli 93,355 94,325 +970 (+1.0%) 🔴
octane-jsx shell_client_js_raw 280,602 281,306 +704 (+0.3%) 🔴
octane-jsx shell_client_js_gzip 90,950 91,136 +186 (+0.2%) 🔴
octane-jsx shell_client_js_brotli 79,513 79,826 +313 (+0.4%) 🔴
octane-jsx shell_client_app_gzip 773 771 −2 (−0.3%) 🟢
octane-jsx shell_client_app_brotli 665 660 −5 (−0.8%) 🟢
octane-jsx shell_client_fw_raw 279,501 280,205 +704 (+0.3%) 🔴
octane-jsx shell_client_fw_gzip 90,177 90,365 +188 (+0.2%) 🔴
octane-jsx shell_client_fw_brotli 78,848 79,166 +318 (+0.4%) 🔴
octane-jsx full_fw_raw 532,454 536,693 +4,239 (+0.8%) 🔴
octane-jsx full_fw_gzip 166,706 167,898 +1,192 (+0.7%) 🔴
octane-jsx full_fw_brotli 141,845 142,829 +984 (+0.7%) 🔴

13 other measured values are unchanged.

Public-import reachability bundles (bytes)

target metric base head Δ
cli-spa-starter raw 77,590 77,849 +259 (+0.3%) 🔴
cli-spa-starter gzip 26,914 27,004 +90 (+0.3%) 🔴
cli-spa-starter brotli 24,200 24,294 +94 (+0.4%) 🔴
root-static-specialized raw 50,454 50,713 +259 (+0.5%) 🔴
root-static-specialized gzip 17,325 17,413 +88 (+0.5%) 🔴
root-static-specialized brotli 15,776 15,848 +72 (+0.5%) 🔴
root-chained-jsx raw 52,605 52,864 +259 (+0.5%) 🔴
root-chained-jsx gzip 18,043 18,128 +85 (+0.5%) 🔴
root-chained-jsx brotli 16,420 16,501 +81 (+0.5%) 🔴
root-static raw 138,125 138,435 +310 (+0.2%) 🔴
root-static gzip 45,294 45,376 +82 (+0.2%) 🔴
root-static brotli 40,321 40,418 +97 (+0.2%) 🔴
root-static-local raw 50,352 50,611 +259 (+0.5%) 🔴
root-static-local gzip 17,282 17,370 +88 (+0.5%) 🔴
root-static-local brotli 15,748 15,802 +54 (+0.3%) 🔴
root-callback-local raw 53,016 53,275 +259 (+0.5%) 🔴
root-callback-local gzip 18,147 18,232 +85 (+0.5%) 🔴
root-callback-local brotli 16,521 16,592 +71 (+0.4%) 🔴
hooks-state raw 61,375 61,634 +259 (+0.4%) 🔴
hooks-state gzip 20,958 21,047 +89 (+0.4%) 🔴
hooks-state brotli 19,066 19,123 +57 (+0.3%) 🔴
prop-attributes raw 58,485 58,744 +259 (+0.4%) 🔴
prop-attributes gzip 20,101 20,188 +87 (+0.4%) 🔴
prop-attributes brotli 18,286 18,432 +146 (+0.8%) 🔴
context raw 69,122 69,381 +259 (+0.4%) 🔴
context gzip 23,288 23,375 +87 (+0.4%) 🔴
context brotli 21,076 21,148 +72 (+0.3%) 🔴
hydrate-root raw 98,671 102,370 +3,699 (+3.7%) 🔴
hydrate-root gzip 33,209 34,292 +1,083 (+3.3%) 🔴
hydrate-root brotli 29,759 30,639 +880 (+3.0%) 🔴
deferred-hydration raw 182,369 186,643 +4,274 (+2.3%) 🔴
deferred-hydration gzip 59,620 60,858 +1,238 (+2.1%) 🔴
deferred-hydration brotli 52,131 53,190 +1,059 (+2.0%) 🔴
hydrate-frame raw 344,878 348,952 +4,074 (+1.2%) 🔴
hydrate-frame gzip 110,847 112,025 +1,178 (+1.1%) 🔴
hydrate-frame brotli 96,430 97,365 +935 (+1.0%) 🔴
suspense-transition raw 114,844 115,497 +653 (+0.6%) 🔴
suspense-transition gzip 37,639 37,833 +194 (+0.5%) 🔴
suspense-transition brotli 33,554 33,685 +131 (+0.4%) 🔴
component-owned-effects raw 54,551 54,810 +259 (+0.5%) 🔴
component-owned-effects gzip 18,657 18,742 +85 (+0.5%) 🔴
component-owned-effects brotli 17,013 17,083 +70 (+0.4%) 🔴
descriptor-children raw 159,802 160,112 +310 (+0.2%) 🔴
descriptor-children gzip 51,965 52,046 +81 (+0.2%) 🔴
descriptor-children brotli 46,194 46,317 +123 (+0.3%) 🔴
binding-hooks raw 63,770 64,029 +259 (+0.4%) 🔴
binding-hooks gzip 21,930 22,017 +87 (+0.4%) 🔴
binding-hooks brotli 19,913 20,015 +102 (+0.5%) 🔴
split-shell raw 395,807 399,883 +4,076 (+1.0%) 🔴
split-shell gzip 129,100 130,279 +1,179 (+0.9%) 🔴
split-shell brotli 112,579 113,474 +895 (+0.8%) 🔴
split-shell-runtime raw 319,104 323,180 +4,076 (+1.3%) 🔴
split-shell-runtime gzip 102,830 104,007 +1,177 (+1.1%) 🔴
split-shell-runtime brotli 88,913 89,823 +910 (+1.0%) 🔴
binding-base-ui-vite raw 170,321 170,631 +310 (+0.2%) 🔴
binding-base-ui-vite gzip 55,611 55,719 +108 (+0.2%) 🔴
binding-base-ui-vite brotli 49,386 49,542 +156 (+0.3%) 🔴
binding-base-ui-esbuild raw 198,569 199,173 +604 (+0.3%) 🔴
binding-base-ui-esbuild gzip 66,735 66,934 +199 (+0.3%) 🔴
binding-base-ui-esbuild brotli 59,084 59,215 +131 (+0.2%) 🔴
binding-radix-vite raw 169,760 170,070 +310 (+0.2%) 🔴
binding-radix-vite gzip 55,276 55,362 +86 (+0.2%) 🔴
binding-radix-vite brotli 49,086 49,187 +101 (+0.2%) 🔴
binding-radix-esbuild raw 198,070 198,674 +604 (+0.3%) 🔴
binding-radix-esbuild gzip 66,447 66,620 +173 (+0.3%) 🔴
binding-radix-esbuild brotli 58,768 59,006 +238 (+0.4%) 🔴
binding-mantine-hooks-vite raw 62,720 62,979 +259 (+0.4%) 🔴
binding-mantine-hooks-vite gzip 21,578 21,662 +84 (+0.4%) 🔴
binding-mantine-hooks-vite brotli 19,582 19,640 +58 (+0.3%) 🔴
binding-mantine-hooks-esbuild raw 77,970 78,451 +481 (+0.6%) 🔴
binding-mantine-hooks-esbuild gzip 27,645 27,811 +166 (+0.6%) 🔴
binding-mantine-hooks-esbuild brotli 24,972 25,051 +79 (+0.3%) 🔴
binding-apollo-client-vite raw 315,070 315,380 +310 (+0.1%) 🔴
binding-apollo-client-vite gzip 98,528 98,636 +108 (+0.1%) 🔴
binding-apollo-client-vite brotli 87,288 87,340 +52 (+0.1%) 🔴
binding-apollo-client-esbuild raw 350,537 351,141 +604 (+0.2%) 🔴
binding-apollo-client-esbuild gzip 113,740 113,935 +195 (+0.2%) 🔴
binding-apollo-client-esbuild brotli 100,370 100,506 +136 (+0.1%) 🔴
binding-usehooks-ts-vite raw 63,501 63,760 +259 (+0.4%) 🔴
binding-usehooks-ts-vite gzip 21,824 21,909 +85 (+0.4%) 🔴
binding-usehooks-ts-vite brotli 19,872 19,905 +33 (+0.2%) 🔴
binding-usehooks-ts-esbuild raw 78,738 79,219 +481 (+0.6%) 🔴
binding-usehooks-ts-esbuild gzip 27,873 28,045 +172 (+0.6%) 🔴
binding-usehooks-ts-esbuild brotli 25,214 25,348 +134 (+0.5%) 🔴

39 other measured values are unchanged.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit 1b7cecc. Configure here.

Comment thread packages/octane/src/runtime/render.ts Resolved
@trueadm
trueadm merged commit a992b16 into octanejs:main Oct 21, 2026
57 of 60 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 21, 2026
trueadm added a commit that referenced this pull request Oct 23, 2026
…ransition holds

The sibling case from #2193 expected Gate's ready reveal to wait for
Later's unrelated transition, the global barrier from before parallel
transitions. Gate's root.render transition and Later's setLater
transition are separate, so Gate now reveals once its own data lands
while Later keeps holding; the primary, listener and event assertions
run at that point.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 23, 2026
* fix(runtime): scope optimistic cleanup to transition batches

* fix(runtime): keep optimistic reverts out of cross-render diagnosis

A transition batch can finish while a Suspense boundary renders: an urgent
update that supersedes a held transition releases the hold inside the
boundary's render (releaseHeldTransition -> releaseTransitionHookHolder ->
finishTransitionHookBatch). The batch-scoped useOptimistic revert then
scheduled its block while another component was on the stack, so dev logged
"Cannot update a component while rendering a different component" and the
block was flagged as a cross-render update. The global listener this
replaced ran under the publish-depth guard; schedule the revert under it
again via scheduleHookPublication.

Also update the TRANSITION_PENDING_COUNT comment: optimistic lifetimes no
longer subscribe to it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(octane): commit unrelated transitions independently

Re-lands #2165 on main. It merged into `next` on 2026-10-20, after
#2103 had already integrated `next` into `main`, and `next` was then
deleted, so the change never reached `main`.

This is the #2165 squash commit (2af686e) without its useOptimistic
fix: #2218 scopes optimistic reverts to their transition batch, so this
change builds on it rather than adding a second mechanism.

React 19.3 renders each transition lane on its own, so a suspended
transition no longer holds back an unrelated one:

- The reveal barrier groups held boundaries that hold a common batch
  (stagedRevealGroup), so one transition's boundaries still reveal
  together while unrelated groups commit on their own, each once per
  flush.
- A held boundary still on screen retries its batches when any thenable
  it suspended on settles, keeping the fresher thenable's resume and
  fallback timeout.

Refs #2053.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(octane): give boundaries without a batch hold their own reveal group

stagedRevealGroup put every held boundary without a batch hold into
every group. That one rule covered three different cases: a transition
that folded no hook work (`root.render` in startTransition), a holder
released during its retry, and members of a view-transition-deferred
reveal. So unrelated groups were pulled together: a hook transition
waited behind an unrelated root.render transition, and a deferred group
could be absorbed into another flush.

Boundaries without a batch hold now form one group of their own, the
barrier before parallel transitions, and never join a batch's group.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(octane): render a deferred value's final attempt while a root holds its first render (#2223)

* fix(octane): render a deferred value's final attempt while a root holds its first render

When a root with no Suspense boundary suspends on its first render, a
useDeferredValue mounted with an initialValue spawned its swap, but the
rollback disposed the slot and the swap was dropped. The final value
never rendered until the preview fully loaded.

The swap now renders the root again as a deferred pass in its host task.
Its suspension keeps the original attempt's wakeable live, so whichever
attempt is ready first commits, as in React 19.3 (react/react#35392).

Ports the two React 19.3.0 ReactDeferredValue-test.js sibling cases into
parallel-transitions.test.ts, and :407 and :526 into deferred-value.test.ts,
asserting committed DOM.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(octane): retry a held root's deferred attempt once per swap task

Each disposed useDeferredValue slot from a rolled-back root render called
owner.retry(true) on its own. With two such hooks, the second deferred
attempt rolled back the first and unioned only its wakeable, so the
original attempt's data no longer retried the root and the initial
values never committed. Collect held roots and retry each once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* test(octane): reveal a parked hydration boundary while an unrelated transition holds

The sibling case from #2193 expected Gate's ready reveal to wait for
Later's unrelated transition, the global barrier from before parallel
transitions. Gate's root.render transition and Later's setLater
transition are separate, so Gate now reveals once its own data lands
while Later keeps holding; the primary, listener and event assertions
run at that point.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: dannyward630 <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent fix PR: bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants