Skip to content

fix(hydration): keep a suspended root's server values and report value mismatches once - #1556

Merged
trueadm merged 4 commits into
mainfrom
fix/root-suspended-value-mismatch
Oct 2, 2026
Merged

trueadm merged 4 commits into
mainfrom
fix/root-suspended-value-mismatch

Conversation

@trueadm

@trueadm trueadm commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #1551. This branch contains #1551's three commits plus one commit of its own, e6f0273. Merge #1551 first; this PR's own change is that last commit. It targets main so repository CI runs: ci.yml only runs for PRs into main.

Summary

Builds on #1551's model, where a root's hydrating attempt reports only if it commits, and extends it to value repairs. A root with no Suspense boundary whose first hydrating attempt repaired a value mismatch and then suspended behaved differently from a hydration that never suspends:

Mismatch Before After
Text Server text showed the client value while pending; never reported (no onRecoverableError, no dev warning) Server text stays; 1 report + 1 dev warning at commit
Style / class (incl. arms inside the root) Patch survived the rollback; warning lost or doubled Server value stays; 1 dev warning at commit
Attribute / dangerouslySetInnerHTML Dev warning logged by the discarded attempt and again by the retry 1 dev warning at commit
xlink:href removed, then rolled back Restored without its namespace (getAttributeNS → null), so the retry saw nothing Restored in its namespace

Why

Changes

  • HydrationCapability.journalRepair(node, attribute | null) runs only when inRootHydrationAttempt() is true. It journals the server text, class, or style before a repair overwrites it. Freshly cloned nodes are skipped. Restoring one would leave a clone that fix(hydration): report a suspended root's rebuilt mismatch once #1551 hasn't removed showing its template placeholder, and the retry would report a false text mismatch; a test covers this.
  • logHydrationMismatch now waits for the root commit for every warning, after the try-body hold (fix(octane): drop hydration diagnostics from try bodies caught by their catch arm #1534). The structural flag is gone. The text recoverable report already goes through fix(hydration): report a suspended root's rebuilt mismatch once #1551's noteRecoverableHydrationError hold.
  • setAttribute passes the namespace it already computes to journalAttr, which records [ns, name] only for namespaced names. Rollback uses setAttributeNS for those. Calling attrNamespace inside rollback instead cost +320 raw / +125 gzip on every client bundle, so I avoided it.
  • Added a changeset and one sentence in the Hydration section of docs/differences-from-react.md.

Validation

  • targeted: tests/hydration/root-suspended-value-mismatch.test.ts, 56 tests × octane/octane-prod, dev and prod compiles. It covers text, sibling text, attribute, three style forms, class, raw HTML, @try arms inside the root, xlink removal and change, a retry that suspends again, a rebuilt @if branch (parity with never suspending), a rebuilt hole clone, and a caught try body (fix(octane): drop hydration diagnostics from try bodies caught by their catch arm #1534 order). Also a client-update xlink rollback case in host-attribute-updates.test.ts.
  • pre-fix: on fix(hydration): report a suspended root's rebuilt mismatch once #1551's runtime, 52 of those tests fail. On the earlier main base, 46 of the first 100 failed.
  • mutation-checked, one at a time: each journal call (text, sibling text, class, style), each warning hold, the namespace restore, the fresh-node skip, and the hold order. Every mutation fails a targeted test.
  • together with fix(hydration): report a suspended root's rebuilt mismatch once #1551's suites (root-suspended-clone-mismatch, try-clone-thrower), plus mismatch-value, host-attribute-updates, style-transaction-rollback: 12 files, 282 tests pass.
  • full octane + octane-prod on the pre-stack revision of this change (same journaling, its own hold helpers): 1303 files, all green after a fix to the test's own site lookup. The 59 binding test files that call hydrateRoot pass.
  • full octane + octane-prod Vitest projects on this stacked head (e6f0273): 1305 files, 36265 tests pass. Repo-wide pnpm test, pnpm typecheck and pnpm format:check are left to CI.
  • pnpm typecheck:files on runtime, the new test, and its fixture. host-attribute-updates.tsrx keeps the 7 implicit-any errors already on main; the new PendingSprite is typed.
  • pnpm format:files:check on all changed files; pnpm sync is clean.

Bundle: the CI benchmark report covers #1551 and this PR together. Subtracting #1551's own report gives this PR's share: client bundles about +56–68 raw / +27–46 gzip (the journal's namespace encoding; e.g. octane-tsrx +66 raw, octane-jsx +68 raw); hydrate-root +387 raw / +95 gzip, on top of #1551's +833 / +230; server scenarios unchanged. No timing verdicts moved: all 20 js-framework operations are within noise. The new code runs only on hydration-mismatch and rollback paths.

Risk / follow-ups

  • In a hydration that never suspends, value warnings now print at the root commit. That's still synchronous inside hydrateRoot, but after any structural warnings from the same pass. An attempt that ends in an uncaught error now drops its value warnings, matching fix(hydration): report a suspended root's rebuilt mismatch once #1551's contract.
  • Arms that suspend on their own (renderInitialSuspenseHydration) are a separate fix, cb7673c. It will conflict mechanically at the call sites next to journalRepair.

Provenance

  • An agent produced this diff (agent-authored)

🤖 Generated with Claude Code


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


Note

Medium Risk
Changes core hydration rollback, journaling, and error reporting for roots that suspend during hydrate; behavior is well-tested but touches sensitive DOM recovery paths.

Overview
When a root hydrates without a Suspense boundary and the first attempt suspends, mismatch recovery no longer leaves half-built client DOM or repaired text/style/class on screen. Structural changes are journaled (HydrationCapability.save, journalRepair, remember) and rolled back with the attempt; only the attempt that commits publishes dev warnings and onRecoverableError (via awaitsCommit / inRootHydrationAttempt).

Value mismatches that used to be patched then hidden (or never reported for text) now stay as server values while pending and are reported once when hydration finishes. Dev hydration warnings follow the same commit gate.

Rollback restores namespaced attributes (xlink:href) with setAttributeNS after journaling [namespace, name].

Docs and new hydration/client-update tests cover structural rebuilds, value repairs, xlink, and parity with non-suspending hydration.

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

trueadm and others added 4 commits October 2, 2026 09:34
A root with no Suspense boundary whose first hydrating attempt rebuilt a
mismatched clone and then suspended published that attempt's diagnostics,
although the root render transaction discarded the attempt. The retry over
the restored server DOM then reported the same mismatch again: two dev
structural warnings and two onRecoverableError calls.

Holding diagnostics alone would have lost reports. A hydrating rollback
keeps the DOM of blocks it created, and childSlot does not journal a first
render inside a block created in the same transaction. So the renderable and
only-child hole, return-slot text, and @for @empty recoveries left a
half-built client subtree in place of the server content while the root was
pending. The HYDRATION_REBUILT marks then silenced the retry.

A root's hydrating attempt is now speculative:
- Structural warnings and onRecoverableError reports wait on the root
  transaction's commit list. The attempt that commits publishes them, and a
  rollback drops them.
- HydrationCapability.save journals the parent's children at every
  structural recovery site through journalRootChildren. Rollback then
  restores the server DOM that the retry adopts and reports.
- Rebuilt-range and rebuilt-host marks are journaled, so a rollback forgets
  them with the DOM they described.
- A structural warning that a try body's diagnostic hold releases re-enters
  logHydrationMismatch, so it reaches the root hold instead of logging
  directly. Value warnings stay outside the root hold: rollback does not
  undo every value repair, so their retry may not repeat them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The try-clone-thrower case for a catch-only boundary whose body suspends
let the suspension reach the root and asserted that the discarded root
attempt reported the rebuilt clone while the promise never resolved. A
suspended root attempt now reports only if it commits, so resolve the
promise and assert the server content stays and nothing reports while
pending, then one report from the attempt that commits. The @pending
boundary case, which commits the root around its suspended arm, is
unchanged.

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

noteRecoverableHydrationError is reachable from shared mount paths, so the
free functions behind the root attempt's commit hold shipped in bundles
that never hydrate. Make the hold a HydrationCapability method,
awaitsCommit, reached through currentHydration like the try-body hold's
`holds`. A diagnostic in a root's hydrating attempt always runs under a
hydration capability, and bundles that never hydrate drop the class.

root-static: +257 -> +123 raw, +87 -> +51 gzip over main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e mismatches once

A root with no Suspense boundary whose first hydrating attempt repaired a
value mismatch and then suspended behaved differently from a hydration that
never suspends:

- Text: the htext/htextSwap nodeValue writes were not journaled, so the
  server text showed the client value while pending. The retry found the
  text already matching, so the mismatch never reached onRecoverableError
  and development logged no warning.
- Style and class: hydration's applyStyle and flushClassWrites writes were
  not journaled either, so a style patch survived the rollback.
- Attribute and dangerouslySetInnerHTML: the discarded attempt and the
  retry each logged the development warning.

In a root's hydrating attempt, HydrationCapability.journalRepair now journals
each server text, class and style value before a repair overwrites it, so
the rollback restores what the retry adopts and reports. Freshly cloned
nodes are skipped: they hold the client template's values, and restoring
one left a visible placeholder and a false text report on the retry.
Attribute setters already journal through journalAttr. With every value
repair undone on rollback, logHydrationMismatch now holds value and
kept-server warnings for the root commit as well as structural ones, still
after a try body's hold.

The journal restored a removed namespaced attribute with setAttribute,
which recreated `xlink:href` without its namespace. That affected client
root updates too. setAttribute now journals the namespace it already
computed, and rollback uses setAttributeNS, without pulling attrNamespace
into every bundle.

Stacked on #1551.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent fix PR: bug fix labels Oct 2, 2026
@trueadm
trueadm marked this pull request as ready for review October 2, 2026 09:24
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark report

  • 🔴 bundle-size: 30 value(s) increased
  • 🔴 bundle-reachability: 68 value(s) increased

Compares 5f354d23e with 84b12ed71 on the same runner. Timing verdicts require a change beyond the combined margin of error (at least 5%) and one 0.1ms timer tick, with the fastest sample also moving beyond that margin. Workflow run

js-framework: 1k/10k row operations (ms, lower is better)

All 20 timed operations (20 within noise)
target operation base head Δ noise
octane-tsrx run 3.42 3.36 −1.8% ±5% ⚪ within noise
octane-tsrx replace 6.60 7.16 +8.5% ±15% ⚪ within noise
octane-tsrx add 3.33 3.39 +1.8% ±13% ⚪ within noise
octane-tsrx update 0.39 0.34 −12.8% ±45% ⚪ within noise
octane-tsrx select 0.11 0.14 +27.3% ±99% ⚪ within noise
octane-tsrx swap 0.34 0.30 −11.8% ±46% ⚪ within noise
octane-tsrx remove 0.31 0.30 −3.2% ±52% ⚪ within noise
octane-tsrx runlots 29.14 31.45 +7.9% ±26% ⚪ within noise
octane-tsrx select_lots 0.19 0.24 +26.3% ±63% ⚪ within noise
octane-tsrx clear 39.72 40.07 +0.9% ±11% ⚪ within noise
octane-jsx run 3.74 3.43 −8.3% ±20% ⚪ within noise
octane-jsx replace 7.19 6.46 −10.2% ±17% ⚪ within noise
octane-jsx add 3.17 3.03 −4.4% ±7% ⚪ within noise
octane-jsx update 0.56 0.55 −1.8% ±28% ⚪ within noise
octane-jsx select 0.39 0.38 −2.6% ±49% ⚪ within noise
octane-jsx swap 0.60 0.66 +10.0% ±28% ⚪ within noise
octane-jsx remove 0.68 0.61 −10.3% ±42% ⚪ within noise
octane-jsx runlots 27.67 27.68 +0.0% ±6% ⚪ within noise
octane-jsx select_lots 2.36 2.32 −1.7% ±18% ⚪ within noise
octane-jsx clear 50.54 40.23 −20.4% ±53% ⚪ within noise

Application bundle size (bytes)

target metric base head Δ
octane-tsrx js_raw 125,830 125,916 +86 (+0.1%) 🔴
octane-tsrx js_gzip 41,583 41,636 +53 (+0.1%) 🔴
octane-tsrx js_brotli 36,652 36,660 +8 (+0.0%) 🔴
octane-tsrx app_gzip 2,563 2,565 +2 (+0.1%) 🔴
octane-tsrx app_brotli 2,224 2,226 +2 (+0.1%) 🔴
octane-tsrx fw_raw 118,318 118,404 +86 (+0.1%) 🔴
octane-tsrx fw_gzip 39,020 39,071 +51 (+0.1%) 🔴
octane-tsrx fw_brotli 34,428 34,434 +6 (+0.0%) 🔴
octane-tsrx todo_js_raw 140,074 140,180 +106 (+0.1%) 🔴
octane-tsrx todo_js_gzip 46,202 46,260 +58 (+0.1%) 🔴
octane-tsrx todo_js_brotli 40,507 40,483 −24 (−0.1%) 🟢
octane-tsrx todo_app_gzip 2,475 2,476 +1 (+0.0%) 🔴
octane-tsrx todo_app_brotli 2,120 2,122 +2 (+0.1%) 🔴
octane-tsrx todo_fw_raw 134,964 135,070 +106 (+0.1%) 🔴
octane-tsrx todo_fw_gzip 43,727 43,784 +57 (+0.1%) 🔴
octane-tsrx todo_fw_brotli 38,387 38,361 −26 (−0.1%) 🟢
octane-tsrx chat_js_raw 139,319 139,425 +106 (+0.1%) 🔴
octane-tsrx chat_js_gzip 46,170 46,215 +45 (+0.1%) 🔴
octane-tsrx chat_js_brotli 40,574 40,657 +83 (+0.2%) 🔴
octane-tsrx chat_app_gzip 2,979 2,978 −1 (−0.0%) 🟢
octane-tsrx chat_app_brotli 2,636 2,631 −5 (−0.2%) 🟢
octane-tsrx chat_fw_raw 132,666 132,772 +106 (+0.1%) 🔴
octane-tsrx chat_fw_gzip 43,191 43,237 +46 (+0.1%) 🔴
octane-tsrx chat_fw_brotli 37,938 38,026 +88 (+0.2%) 🔴
octane-tsrx weather_js_raw 175,134 175,250 +116 (+0.1%) 🔴
octane-tsrx weather_js_gzip 57,142 57,205 +63 (+0.1%) 🔴
octane-tsrx weather_js_brotli 49,728 49,713 −15 (−0.0%) 🟢
octane-tsrx weather_app_brotli 7,607 7,602 −5 (−0.1%) 🟢
octane-tsrx weather_fw_raw 148,399 148,515 +116 (+0.1%) 🔴
octane-tsrx weather_fw_gzip 48,098 48,161 +63 (+0.1%) 🔴
octane-tsrx weather_fw_brotli 42,121 42,111 −10 (−0.0%) 🟢
octane-jsx js_raw 224,162 224,353 +191 (+0.1%) 🔴
octane-jsx js_gzip 71,390 71,483 +93 (+0.1%) 🔴
octane-jsx js_brotli 61,820 61,880 +60 (+0.1%) 🔴
octane-jsx fw_raw 215,695 215,886 +191 (+0.1%) 🔴
octane-jsx fw_gzip 68,447 68,540 +93 (+0.1%) 🔴
octane-jsx fw_brotli 59,320 59,380 +60 (+0.1%) 🔴

8 other measured values are unchanged.

Public-import reachability bundles (bytes)

target metric base head Δ
cli-spa-starter raw 115,639 115,725 +86 (+0.1%) 🔴
cli-spa-starter gzip 39,002 39,055 +53 (+0.1%) 🔴
cli-spa-starter brotli 34,103 34,147 +44 (+0.1%) 🔴
root-static-specialized raw 76,615 76,671 +56 (+0.1%) 🔴
root-static-specialized gzip 25,358 25,397 +39 (+0.2%) 🔴
root-static-specialized brotli 22,574 22,602 +28 (+0.1%) 🔴
root-chained-jsx raw 85,481 85,537 +56 (+0.1%) 🔴
root-chained-jsx gzip 28,288 28,324 +36 (+0.1%) 🔴
root-chained-jsx brotli 25,171 25,143 −28 (−0.1%) 🟢
root-static raw 200,485 200,676 +191 (+0.1%) 🔴
root-static gzip 63,565 63,652 +87 (+0.1%) 🔴
root-static brotli 55,155 55,219 +64 (+0.1%) 🔴
root-static-local raw 76,618 76,674 +56 (+0.1%) 🔴
root-static-local gzip 25,347 25,385 +38 (+0.1%) 🔴
root-static-local brotli 22,577 22,641 +64 (+0.3%) 🔴
hooks-state raw 88,663 88,719 +56 (+0.1%) 🔴
hooks-state gzip 29,402 29,429 +27 (+0.1%) 🔴
hooks-state brotli 26,184 26,221 +37 (+0.1%) 🔴
prop-attributes raw 96,807 96,873 +66 (+0.1%) 🔴
prop-attributes gzip 32,115 32,156 +41 (+0.1%) 🔴
prop-attributes brotli 28,462 28,523 +61 (+0.2%) 🔴
context raw 109,353 109,419 +66 (+0.1%) 🔴
context gzip 36,153 36,195 +42 (+0.1%) 🔴
context brotli 31,916 31,977 +61 (+0.2%) 🔴
hydrate-root raw 156,619 157,839 +1,220 (+0.8%) 🔴
hydrate-root gzip 50,209 50,534 +325 (+0.6%) 🔴
hydrate-root brotli 43,760 44,018 +258 (+0.6%) 🔴
deferred-hydration raw 218,779 220,007 +1,228 (+0.6%) 🔴
deferred-hydration gzip 69,631 69,973 +342 (+0.5%) 🔴
deferred-hydration brotli 60,127 60,428 +301 (+0.5%) 🔴
suspense-transition raw 165,315 165,381 +66 (+0.0%) 🔴
suspense-transition gzip 53,028 53,070 +42 (+0.1%) 🔴
suspense-transition brotli 46,256 46,294 +38 (+0.1%) 🔴
component-owned-effects raw 81,111 81,167 +56 (+0.1%) 🔴
component-owned-effects gzip 26,698 26,732 +34 (+0.1%) 🔴
component-owned-effects brotli 23,755 23,834 +79 (+0.3%) 🔴
binding-hooks raw 87,175 87,231 +56 (+0.1%) 🔴
binding-hooks gzip 29,158 29,191 +33 (+0.1%) 🔴
binding-hooks brotli 25,879 25,993 +114 (+0.4%) 🔴
binding-base-ui-vite raw 210,679 210,870 +191 (+0.1%) 🔴
binding-base-ui-vite gzip 67,120 67,207 +87 (+0.1%) 🔴
binding-base-ui-vite brotli 58,186 58,335 +149 (+0.3%) 🔴
binding-base-ui-esbuild raw 208,666 208,853 +187 (+0.1%) 🔴
binding-base-ui-esbuild gzip 67,114 67,196 +82 (+0.1%) 🔴
binding-base-ui-esbuild brotli 58,195 58,254 +59 (+0.1%) 🔴
binding-radix-vite raw 212,608 212,799 +191 (+0.1%) 🔴
binding-radix-vite gzip 67,700 67,778 +78 (+0.1%) 🔴
binding-radix-vite brotli 58,674 58,781 +107 (+0.2%) 🔴
binding-radix-esbuild raw 210,554 210,741 +187 (+0.1%) 🔴
binding-radix-esbuild gzip 67,683 67,779 +96 (+0.1%) 🔴
binding-radix-esbuild brotli 58,686 58,849 +163 (+0.3%) 🔴
binding-mantine-hooks-vite raw 97,451 97,507 +56 (+0.1%) 🔴
binding-mantine-hooks-vite gzip 32,353 32,387 +34 (+0.1%) 🔴
binding-mantine-hooks-vite brotli 28,665 28,765 +100 (+0.3%) 🔴
binding-mantine-hooks-esbuild raw 97,047 97,101 +54 (+0.1%) 🔴
binding-mantine-hooks-esbuild gzip 32,533 32,568 +35 (+0.1%) 🔴
binding-mantine-hooks-esbuild brotli 28,883 28,926 +43 (+0.1%) 🔴
binding-apollo-client-vite raw 355,728 355,919 +191 (+0.1%) 🔴
binding-apollo-client-vite gzip 111,226 111,326 +100 (+0.1%) 🔴
binding-apollo-client-vite brotli 97,000 97,200 +200 (+0.2%) 🔴
binding-apollo-client-esbuild raw 358,719 358,906 +187 (+0.1%) 🔴
binding-apollo-client-esbuild gzip 113,475 113,560 +85 (+0.1%) 🔴
binding-apollo-client-esbuild brotli 98,872 98,923 +51 (+0.1%) 🔴
binding-usehooks-ts-vite raw 98,084 98,140 +56 (+0.1%) 🔴
binding-usehooks-ts-vite gzip 32,513 32,549 +36 (+0.1%) 🔴
binding-usehooks-ts-vite brotli 28,880 28,910 +30 (+0.1%) 🔴
binding-usehooks-ts-esbuild raw 97,669 97,723 +54 (+0.1%) 🔴
binding-usehooks-ts-esbuild gzip 32,685 32,718 +33 (+0.1%) 🔴
binding-usehooks-ts-esbuild brotli 29,016 29,066 +50 (+0.2%) 🔴

36 other measured values are unchanged.

CI job durations

  • 🟡 8 job(s) slower than every recent main run: test shard (Node 24, 2/4), test shard (Node 24, 1/4), test shard (Node 24, 3/4), test shard (Node 24, 4/4), lint checks, website integration suite, validate publishable packages, example apps (3/3)
  • 🟢 2 job(s) faster than every recent main run: typecheck checks, React parity checks

Compares the CI run for e6f027384 (run) with the last 3 successful main push runs. A job is only slower or faster outside the whole main range, by at least 10% and 15s. Job time excludes runner setup.

job main median main range this PR Δ
wall clock (first job start to last job end) 8m 39s 7m 39s–8m 45s 20m 13s +11m 34s (+134%) ⚪ partial run
total job time 87m 11s 86m 21s–91m 45s 137m 50s +50m 39s (+58%) ⚪ partial run
test shard (Node 24, 2/4) 5m 23s 5m 21s–5m 35s 12m 16s +6m 53s (+128%) 🟡 slower
test shard (Node 24, 1/4) 6m 09s 6m 05s–6m 09s 11m 51s +5m 42s (+93%) 🟡 slower
test shard (Node 24, 3/4) 5m 28s 5m 17s–5m 35s 10m 27s +4m 59s (+91%) 🟡 slower
test shard (Node 24, 4/4) 5m 45s 4m 34s–6m 08s 10m 18s +4m 33s (+79%) 🟡 slower
lint checks 3m 17s 2m 50s–3m 26s 7m 45s +4m 28s (+136%) 🟡 slower
website integration suite 3m 49s 3m 44s–4m 00s 5m 52s +2m 03s (+54%) 🟡 slower
validate publishable packages 2m 22s 2m 21s–2m 30s 3m 50s +1m 28s (+62%) 🟡 slower
example apps (3/3) 2m 57s 2m 54s–2m 59s 3m 21s +24s (+14%) 🟡 slower
typecheck checks 4m 32s 3m 54s–4m 33s 1m 58s −2m 34s (−57%) 🟢 faster
React parity checks 2m 45s 2m 44s–2m 46s 11s −2m 34s (−93%) 🟢 faster

Not compared (skipped, failed, or not run on this pull request): Lynx compatibility (minimum), heavy integration (runtime-loaders), Three compatibility (minimum r156), Three compatibility (current), heavy integration (browser), heavy integration (eval-corpus), Lynx compatibility (current), test shard (Node 22.22.2, 1/4), heavy integration (package-builds), heavy integration (astro), test shard (Node 22.22.2, 2/4), test shard (Node 22.22.2, 3/4), test shard (Node 22.22.2, 4/4), test (22).

All 26 timed jobs
job main median main range this PR Δ
React parity shard (3/4) – – 9m 28s – 🆕 new
React parity shard (2/4) – – 9m 54s – 🆕 new
Three compatibility – – 2m 48s – 🆕 new
React parity shard (1/4) – – 10m 45s – 🆕 new
heavy integration (browser - chromium) – – 11m 28s – 🆕 new
heavy integration (package builds, eval corpus, runtime loaders, Astro) – – 5m 26s – 🆕 new
Lynx compatibility – – 1m 32s – 🆕 new
React parity shard (4/4) – – 11m 18s – 🆕 new
test shard (Node 24, 2/4) 5m 23s 5m 21s–5m 35s 12m 16s +6m 53s (+128%) 🟡 slower
test shard (Node 24, 1/4) 6m 09s 6m 05s–6m 09s 11m 51s +5m 42s (+93%) 🟡 slower
test shard (Node 24, 3/4) 5m 28s 5m 17s–5m 35s 10m 27s +4m 59s (+91%) 🟡 slower
test shard (Node 24, 4/4) 5m 45s 4m 34s–6m 08s 10m 18s +4m 33s (+79%) 🟡 slower
lint checks 3m 17s 2m 50s–3m 26s 7m 45s +4m 28s (+136%) 🟡 slower
website integration suite 3m 49s 3m 44s–4m 00s 5m 52s +2m 03s (+54%) 🟡 slower
validate publishable packages 2m 22s 2m 21s–2m 30s 3m 50s +1m 28s (+62%) 🟡 slower
example apps (2/3) 3m 16s 3m 16s–5m 23s 3m 51s +35s (+18%) ⚪ within noise
example apps (3/3) 2m 57s 2m 54s–2m 59s 3m 21s +24s (+14%) 🟡 slower
example apps (1/3) 2m 59s 2m 54s–3m 00s 3m 04s +5s (+3%) ⚪ within noise
classify changeset release 9s 8s–10s 13s +4s (+44%) ⚪ within noise
lint 2s 2s–2s 3s +1s (+50%) ⚪ within noise
typecheck 2s 2s–3s 3s +1s (+50%) ⚪ within noise
test (24) 2s 1s–3s 3s +1s (+50%) ⚪ within noise
examples 3s 2s–3s 3s ±0s (±0%) ⚪ within noise
CI provenance 3s 2s–3s 2s −1s (−33%) ⚪ within noise
typecheck checks 4m 32s 3m 54s–4m 33s 1m 58s −2m 34s (−57%) 🟢 faster
React parity checks 2m 45s 2m 44s–2m 46s 11s −2m 34s (−93%) 🟢 faster

@trueadm
trueadm merged commit d930afb into main Oct 2, 2026
77 of 80 checks passed
@trueadm
trueadm deleted the fix/root-suspended-value-mismatch branch October 2, 2026 11:01
trueadm added a commit that referenced this pull request Oct 2, 2026
…ttempt rebuilt a mismatch (#1560)

* fix(hydration): keep server values in a suspended @Try arm and report once at commit

A resolved @Try arm (server emitted oct-suspense:N) hydrates speculatively:
when its first attempt suspends, the attempt is discarded and a later one
adopts the same server nodes. An attempt that repaired a text or attribute
value before suspending wrote the client value into the server's markup while
the arm was still pending, and queued the text warning on a capability that
the suspension dropped. The committing attempt then found the value already
matching, so the mismatch never reached onRecoverableError or the dev warning.

The arm's HydrationCapability is now speculative. Before it overwrites a
server text value, attribute, class or style, it records the server value, and
rollback() restores them when the attempt suspends or throws. Nodes cloned
fresh by structural recovery hold client template values and are skipped.
Value warnings (attribute, class, style, kept dangerouslySetInnerHTML) are held
until the attempt settles. A nested arm that commits inside an enclosing
speculative attempt hands its records and pending warnings to that attempt.

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

* perf(hydration): read the repaired server value only in a speculative attempt

Move the speculative check and the server-value read into
HydrationCapability.repaired(), so each repair site is one call. A
non-speculative hydration no longer reads the class or style attribute at
all on the mismatch path, and hydrate-root / deferred-hydration shrink by
87 raw bytes.

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

* fix(hydration): keep a suspended @Try arm's server content when its attempt rebuilt a mismatch

A resolved @Try arm (oct-suspense:N) whose first hydrating attempt rebuilt a
mismatched template clone and then suspended removed the server node while
the attempt was discarded, left the arm blank while pending, and reported the
structural mismatch twice (dev warning and onRecoverableError, dev and prod):
the retry found only the range's close marker and reported again.

A speculative attempt now keeps one undo list. save(parent) snapshots a
parent's children once before structural recovery changes them (the same
sites #1556 journals for roots, plus the de-opt reconcile); remember() makes
HYDRATION_REBUILT marks undoable; #1544's value repairs push restore steps
onto the same list. settle() hands the list to an enclosing speculative
attempt and rollback() replays it newest first. Any failed attempt rolls back
and drops its held diagnostics, so the attempt that commits reports each
mismatch once. #1544's heldWarnings/repairs log fold into this list and
#1534's hold. collectRootRange/restoreRootRange are shared with
journalRootRange, and a dormant island's staleServerValues now carries to
retries.

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

* fix(hydration): undo de-opt children a suspended @Try arm inserted or moved

reconcileDeoptChildren recorded a speculative snapshot of a server host only
when it removed a child. Filling an empty server host, or inserting and moving
children in its ordering pass, journaled only for the root, so a resolved @Try
arm that hit those paths and then suspended left client-built children in the
server markup while pending. Record the host before both, through a cold
helper that does nothing outside a hydrating attempt or for a fresh host.

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

* fix(hydration): skip restoring a range whose bounds left their parent

The speculative arm's undo called restoreRootRange without the check that
journalRootRange makes first: when either bound is no longer in the parent,
the snapshot owns no range there, and walking to a bound that is gone sweeps
the parent's later siblings and then inserts before a detached anchor. Move
the check into restoreRootRange so both callers share it. Recovery cannot
detach an arm's own bounds in balanced markup; the regression simulates an
outside mutation during the suspended attempt.

Co-Authored-By: Claude Opus 5.5 <[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.

1 participant