Skip to content

fix(octane): keep updating an only text child after page translation - #1915

Merged
trueadm merged 5 commits into
mainfrom
fix/translated-only-child-text
Oct 8, 2026
Merged

trueadm merged 5 commits into
mainfrom
fix/translated-only-child-text

Conversation

@trueadm

@trueadm trueadm commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

When the browser translates the page, an element's only text child stops updating. This
fixes that to match React.

Chrome's page translator replaces each Text node with nested <font> wrappers holding the
translation, then detaches the original node. On the next update, React's
setTextContent sees the host no longer holds a single Text node and writes
textContent, so the page shows the new message. Octane kept writing nodeValue into the
detached node, so <span>{message}</span> and <span>{message as string}</span> went on
showing the stale translation. Switching that child to an element left the <font> beside
the new element. Switching it to nothing left the translation in place.

Changes

  • Renderable only-child holes. This covers childTextHoleUpdate, the keyed-row inline
    guard, and childTextHole. They pass their host to setText(node, value, host). One
    parentNode === host read confirms the cached Text is still what the host shows.
    • When it is not, resetOnlyChildHost clears the host and re-appends the binding's own
      Text, so every cache holding that node stays valid. Under a root render transaction,
      the host's previous children are journaled first.
    • The mode switches to '' and to an element clear a translated host instead of calling
      remove() on a detached node.
  • {x as string} where another binding already keeps the host in the bag (for example
    a class binding). The compiler passes that shared host to setText, so no new field is
    added.
  • {x as string} on a seeded native host with no other stored binding. The bag keeps
    the host in place of the Text, so the field count is unchanged. The update calls
    setText(null, value, host): with no node, setText writes the host's first child, and
    resets the host when that child is not a Text.
    • Custom-element and <template> hosts, whose Text may follow children they do not own,
      keep the Text and store a host field.
  • Spread-host renderable holes (bindSignalChild's primitive token path). The hole
    checks that the host's first child is a Text before reusing it.
  • Unchanged: text beside sibling nodes. React's HostText write misses a translated node
    too, so that path is already at parity.

setText stays the only text writer, so its view-transition dirty marking, journaling, and
production call counts are unchanged. Compiled output imports nothing new.

Validation

  • pnpm format:check: left to CI. pnpm format:files:check passed on every changed
    file.
  • pnpm typecheck: left to CI. pnpm typecheck:files passed on runtime.ts, the
    tests, and both fixtures.
  • pnpm test: left to CI.
  • Targeted tests.
    • differential/translated-text.test.ts runs the same .tsrx through Octane and
      @tsrx/react (10 cases). hydration/translated-text-hydrate.test.ts adds 5
      server-render-then-hydrate cases.
    • All 15 pass in the octane and octane-prod projects.
    • On origin/main, 14 of the 15 fail. The one that passes there is a spread host switching
      text → element: the old token path removed the <font> by accident.
    • Paths covered:
      • {x as string} on a plain host, on a host with a class binding, and on a custom
        element
      • {x}
      • keyed rows, both inline-guard and state-reading
      • spread host
      • text → '' and text → element
      • hydrated server text
    • Nearby files also pass: dom-template-text, helper-shadowing, binding-handoff*,
      signals-native-collection.abi, compiler-map-coverage, volar.
  • perf-review (report below).

Performance

Base is origin/main 385d6ab. Both sides used the same machine, commands, and browser.

Measurement Result
js-framework, pair.mjs (the PR bench harness), 30 pairs, both fixtures every op within ±3%. tsrx update 1.023 [1.009, 1.036]. Isolated update repeats: 1.004, 1.014, 0.997. A/A control: 1.009, 1.014
js-framework work counters (pair.mjs --work-only) all 40 counters identical to base (calls, DOM mutations, live insertions)
dbmon, 6 alternating rounds with an A/A base pair tsrx tick 1.004 (A/A rounds 0.984–1.017); every other tsrx op within 1%. JSX tick 1.015, all 6 rounds above 1.0: about +36 µs on a 2.45 ms tick that does about 6,000 only-child writes, i.e. one parentNode read (~6 ns) per write
JS heap, 10k js-framework rows after GC −15 B per row (661 vs 676). The bag holds the host instead of the Text
Bundle gzip (bundle-size/run.mjs) app code −22 to +46 B; runtime +83 to +146 B (the repair helpers); runtime ceiling +130 B. Compiled .tsrx output across the benchmark apps: net −3 B raw
Chromium microbench, ns per text write with mixed host tags direct write 44; parentNode check 48; host.firstChild + nodeType 58; React's check costs more than either

Two designs were measured and rejected:

  • Always caching the Text and storing the host: +24 B heap per row (+3.5%), weather app
    gzip +190, and ForecastItem overflowed bag14 into bagOf. The changed bag shape also
    made tsrx update JIT-bimodal, ranging 0.878–1.090 over 6 runs.
  • Always storing the host: dbmon tsrx tick +4.3%, because class-bound cells paid two
    reads per write.

Perf review: fix/translated-only-child-text (origin/main..cee9345)

Scan: node scripts/perf-review-scan.mjs, 0 candidates.

Hot paths touched:

  • setText: per text write. It gains host !== undefined, plus one parentNode read when a
    host is passed.
  • setText(null, value, host): per seeded {x as string} update on a host with no other
    stored binding. One firstChild read and one nodeType read instead of the cached Text.
  • childTextHoleUpdate and the inline guard: per renderable only-child update. They pass
    the host.
  • bindSignalChild: per changed spread-host primitive. It gains a nodeType read next to
    its existing firstChild read.
# Severity Location Dimension Finding Required evidence Provided?
1 needs-evidence packages/octane/src/runtime.ts setText DOM / CPU One extra DOM read per only-child text write js-framework pair, dbmon base vs head with A/A yes: JSX dbmon tick +1.5% (~6 ns/write), everything else within noise
2 note packages/octane/src/compiler/compile.js onlyTextKeepsHost compiler output / shapes Bag field counts unchanged except custom-element and <template> text hosts (+1) compiled output diff, heap per row yes: −3 B raw compiled, −15 B per row
3 note setText calls Host-only bindings call setText(null, value, host) rather than a wrapper, so production calls stay level and the compiled output imports only from octane work counters yes: all 40 counters identical

Cold paths: resetOnlyChildHost and removeOnlyChildText run only after an external edit
or on a mode switch. No new allocation on the hot paths, no scheduling change, no layout
reads.

Risk / follow-ups

  • The per-write parentNode read is the cost of noticing an external edit at all. React
    pays three reads on the same path. In the densest text-update benchmark (dbmon JSX) it
    shows up as about 1.5%; it does not show up on js-framework.
  • After a repair, the translator's own MutationObserver usually re-translates the new text,
    which then repeats on the next update. That is React's behavior too.
  • Not covered: text driven directly by octane/signals outside a render has the same gap.
    That covers writeDirectSignalBoundText, writeDirectSignalText, the bindSignalText
    scalar path, and updateDirectSignalChild, none of which has a React counterpart.
  • Related: fix(octane): adopt DOM bindings over browser-translated text leaves #1909 handles DOM-binding adoption over translated text leaves (DOM bindings: native Chrome Translate causes #318 before adoption, including hidden views #1904). It
    touches different files.

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
Touches the hot setText path and DOM reconciliation for all only-child text bindings, with a small per-update DOM read cost; behavior is aligned with React but affects core rendering.

Overview
Fixes stale translated text when Chrome’s page translator replaces an element’s sole Text child with <font> wrappers and detaches the original node. Octane kept updating that detached node; updates now detect translator DOM and reset the host (like React’s setTextContent) before writing the new value.

Runtime: setText accepts an optional host; when the cached Text is missing or no longer under the host, resetOnlyChildHost clears translator markup and re-attaches the binding’s text node. Renderable only-child holes, childTextHoleUpdate, and spread-host primitive paths pass the host through; mode switches to empty or element content clear translated wrappers instead of remove() on a detached node.

Compiler: Only-child text bindings emit host-aware setText calls (onlyTextKeepsHost can store the host instead of a separate _txt field when no other binding owns it). Bag helpers gain has / hasHost for that layout.

Tests: Differential vs React (10 cases), hydration after server render (5), plus a Chrome-like translateTextHosts helper and .tsrx fixtures.

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

Chrome's page translator replaces a Text node with nested <font> wrappers
and detaches the original. React's setTextContent then rewrites the host's
content, but Octane kept writing the detached node, so the stale
translation stayed on screen. Switching that child to an element or to
nothing also left the translation behind.

Renderable only-child holes and `{x as string}` bindings whose host is
already in the binding bag pass the host to setText, which checks the
Text's parent once and restores the Text into the host when a translator
took it out. A seeded native host with no other stored binding keeps the
host in place of the Text, so the bag gains no field; setOnlyText writes
the host's first child and resets the host when that is not a Text.
childTextHole and the spread-host signal child clear a translated host on
a mode switch.

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 8, 2026
@github-actions
github-actions Bot marked this pull request as draft October 8, 2026 18:53
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark report

  • 🔴 bundle-size: 57 value(s) increased
  • 🔴 bundle-reachability: 65 value(s) increased

Compares 9c440f4bd, the merge commit's first parent with a708bca80 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.000 3.225 +3.5% −1.9% … +6.9% ⚪ within noise
octane-tsrx replace 11.900 10.300 −7.9% −18.3% … +0.8% ⚪ within noise
octane-tsrx add 3.517 3.267 −0.1% −8.6% … +9.7% ⚪ within noise
octane-tsrx update 0.140 0.147 +2.1% −2.1% … +7.5% ⚪ within noise
octane-tsrx select 0.006 0.006 +0.3% −1.2% … +1.5% ⚪ within noise
octane-tsrx swap 0.030 0.031 +2.3% +1.2% … +4.8% ⚪ within noise
octane-tsrx remove 0.018 0.018 −2.5% −8.5% … ±0.0% ⚪ within noise
octane-tsrx runlots 25.917 25.575 +0.9% −3.1% … +2.5% ⚪ within noise
octane-tsrx select_lots 0.007 0.007 +1.6% −0.0% … +5.3% ⚪ within noise
octane-tsrx clear 89.658 91.400 +2.8% −2.9% … +8.6% ⚪ within noise
octane-jsx run 5.617 5.675 +0.8% −7.7% … +9.5% ⚪ within noise
octane-jsx replace 11.867 11.925 +2.7% −3.7% … +8.8% ⚪ within noise
octane-jsx add 5.467 5.283 +1.7% −5.1% … +10.5% ⚪ within noise
octane-jsx update 0.378 0.389 +2.2% −12.7% … +8.6% ⚪ within noise
octane-jsx select 0.188 0.196 +9.3% −4.2% … +23.2% ⚪ within noise
octane-jsx swap 0.312 0.301 −1.0% −9.5% … +2.1% ⚪ within noise
octane-jsx remove 0.223 0.242 +4.2% −2.4% … +10.0% ⚪ within noise
octane-jsx runlots 38.850 40.183 +3.7% −5.1% … +8.9% ⚪ within noise
octane-jsx select_lots 1.665 1.671 −1.5% −5.5% … +2.4% ⚪ within noise
octane-jsx clear 55.992 60.050 +0.5% −2.9% … +7.4% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

target metric base head Δ
octane-tsrx js_raw 113,268 113,570 +302 (+0.3%) 🔴
octane-tsrx js_gzip 37,021 37,097 +76 (+0.2%) 🔴
octane-tsrx js_brotli 32,775 32,860 +85 (+0.3%) 🔴
octane-tsrx app_raw 6,946 6,948 +2 (+0.0%) 🔴
octane-tsrx app_gzip 2,336 2,337 +1 (+0.0%) 🔴
octane-tsrx app_brotli 2,034 2,038 +4 (+0.2%) 🔴
octane-tsrx fw_raw 106,322 106,622 +300 (+0.3%) 🔴
octane-tsrx fw_gzip 34,685 34,760 +75 (+0.2%) 🔴
octane-tsrx fw_brotli 30,741 30,822 +81 (+0.3%) 🔴
octane-tsrx todo_js_raw 121,657 121,959 +302 (+0.2%) 🔴
octane-tsrx todo_js_gzip 39,853 39,934 +81 (+0.2%) 🔴
octane-tsrx todo_js_brotli 35,060 35,184 +124 (+0.4%) 🔴
octane-tsrx todo_app_raw 4,618 4,620 +2 (+0.0%) 🔴
octane-tsrx todo_app_gzip 2,219 2,221 +2 (+0.1%) 🔴
octane-tsrx todo_app_brotli 1,882 1,887 +5 (+0.3%) 🔴
octane-tsrx todo_fw_raw 117,039 117,339 +300 (+0.3%) 🔴
octane-tsrx todo_fw_gzip 37,634 37,713 +79 (+0.2%) 🔴
octane-tsrx todo_fw_brotli 33,178 33,297 +119 (+0.4%) 🔴
octane-tsrx chat_js_raw 120,406 120,712 +306 (+0.3%) 🔴
octane-tsrx chat_js_gzip 39,658 39,750 +92 (+0.2%) 🔴
octane-tsrx chat_js_brotli 35,001 35,100 +99 (+0.3%) 🔴
octane-tsrx chat_app_raw 5,765 5,771 +6 (+0.1%) 🔴
octane-tsrx chat_app_gzip 2,714 2,718 +4 (+0.1%) 🔴
octane-tsrx chat_app_brotli 2,388 2,386 −2 (−0.1%) 🟢
octane-tsrx chat_fw_raw 114,641 114,941 +300 (+0.3%) 🔴
octane-tsrx chat_fw_gzip 36,944 37,032 +88 (+0.2%) 🔴
octane-tsrx chat_fw_brotli 32,613 32,714 +101 (+0.3%) 🔴
octane-tsrx weather_js_raw 157,011 157,327 +316 (+0.2%) 🔴
octane-tsrx weather_js_gzip 51,057 51,109 +52 (+0.1%) 🔴
octane-tsrx weather_js_brotli 44,587 44,660 +73 (+0.2%) 🔴
octane-tsrx weather_app_raw 22,154 22,170 +16 (+0.1%) 🔴
octane-tsrx weather_app_gzip 7,872 7,845 −27 (−0.3%) 🟢
octane-tsrx weather_app_brotli 6,663 6,683 +20 (+0.3%) 🔴
octane-tsrx weather_fw_raw 134,857 135,157 +300 (+0.2%) 🔴
octane-tsrx weather_fw_gzip 43,185 43,264 +79 (+0.2%) 🔴
octane-tsrx weather_fw_brotli 37,924 37,977 +53 (+0.1%) 🔴
octane-tsrx bindings_js_raw 690,612 691,068 +456 (+0.1%) 🔴
octane-tsrx bindings_js_gzip 225,751 225,914 +163 (+0.1%) 🔴
octane-tsrx bindings_js_brotli 191,847 192,009 +162 (+0.1%) 🔴
octane-tsrx bindings_app_raw 347,638 347,653 +15 (+0.0%) 🔴
octane-tsrx bindings_app_gzip 115,666 115,683 +17 (+0.0%) 🔴
octane-tsrx bindings_app_brotli 96,169 96,232 +63 (+0.1%) 🔴
octane-tsrx bindings_fw_raw 342,974 343,415 +441 (+0.1%) 🔴
octane-tsrx bindings_fw_gzip 110,085 110,231 +146 (+0.1%) 🔴
octane-tsrx bindings_fw_brotli 95,678 95,777 +99 (+0.1%) 🔴
octane-tsrx full_fw_raw 570,837 571,286 +449 (+0.1%) 🔴
octane-tsrx full_fw_gzip 172,263 172,377 +114 (+0.1%) 🔴
octane-tsrx full_fw_brotli 144,782 144,960 +178 (+0.1%) 🔴
octane-jsx js_raw 187,845 188,294 +449 (+0.2%) 🔴
octane-jsx js_gzip 59,661 59,791 +130 (+0.2%) 🔴
octane-jsx js_brotli 51,917 52,047 +130 (+0.3%) 🔴
octane-jsx app_raw 8,265 8,273 +8 (+0.1%) 🔴
octane-jsx app_brotli 2,407 2,410 +3 (+0.1%) 🔴
octane-jsx fw_raw 179,580 180,021 +441 (+0.2%) 🔴
octane-jsx fw_gzip 56,802 56,932 +130 (+0.2%) 🔴
octane-jsx fw_brotli 49,510 49,637 +127 (+0.3%) 🔴
octane-jsx full_fw_raw 570,837 571,286 +449 (+0.1%) 🔴
octane-jsx full_fw_gzip 172,263 172,377 +114 (+0.1%) 🔴
octane-jsx full_fw_brotli 144,782 144,960 +178 (+0.1%) 🔴

1 other measured values are unchanged.

Public-import reachability bundles (bytes)

target metric base head Δ
cli-spa-starter raw 102,316 102,618 +302 (+0.3%) 🔴
cli-spa-starter gzip 34,145 34,214 +69 (+0.2%) 🔴
cli-spa-starter brotli 30,063 30,102 +39 (+0.1%) 🔴
root-chained-jsx raw 74,827 75,971 +1,144 (+1.5%) 🔴
root-chained-jsx gzip 24,488 24,821 +333 (+1.4%) 🔴
root-chained-jsx brotli 21,900 22,205 +305 (+1.4%) 🔴
root-static raw 165,663 166,104 +441 (+0.3%) 🔴
root-static gzip 52,417 52,546 +129 (+0.2%) 🔴
root-static brotli 45,657 45,709 +52 (+0.1%) 🔴
root-callback-local raw 74,853 75,997 +1,144 (+1.5%) 🔴
root-callback-local gzip 24,498 24,819 +321 (+1.3%) 🔴
root-callback-local brotli 21,970 22,196 +226 (+1.0%) 🔴
hooks-state raw 84,671 85,815 +1,144 (+1.4%) 🔴
hooks-state gzip 27,926 28,222 +296 (+1.1%) 🔴
hooks-state brotli 24,903 25,157 +254 (+1.0%) 🔴
prop-attributes raw 84,924 86,071 +1,147 (+1.4%) 🔴
prop-attributes gzip 27,939 28,293 +354 (+1.3%) 🔴
prop-attributes brotli 24,915 25,265 +350 (+1.4%) 🔴
context raw 96,856 97,155 +299 (+0.3%) 🔴
context gzip 31,625 31,697 +72 (+0.2%) 🔴
context brotli 28,135 28,164 +29 (+0.1%) 🔴
hydrate-root raw 138,323 138,624 +301 (+0.2%) 🔴
hydrate-root gzip 44,371 44,432 +61 (+0.1%) 🔴
hydrate-root brotli 38,877 38,905 +28 (+0.1%) 🔴
deferred-hydration raw 221,680 221,981 +301 (+0.1%) 🔴
deferred-hydration gzip 69,935 69,996 +61 (+0.1%) 🔴
deferred-hydration brotli 60,307 60,421 +114 (+0.2%) 🔴
hydrate-frame raw 366,260 366,704 +444 (+0.1%) 🔴
hydrate-frame gzip 113,719 113,846 +127 (+0.1%) 🔴
hydrate-frame brotli 97,245 97,402 +157 (+0.2%) 🔴
suspense-transition raw 143,502 143,803 +301 (+0.2%) 🔴
suspense-transition gzip 45,507 45,587 +80 (+0.2%) 🔴
suspense-transition brotli 39,940 39,982 +42 (+0.1%) 🔴
binding-hooks raw 83,169 84,317 +1,148 (+1.4%) 🔴
binding-hooks gzip 27,586 27,907 +321 (+1.2%) 🔴
binding-hooks brotli 24,600 24,980 +380 (+1.5%) 🔴
binding-base-ui-vite raw 201,517 201,958 +441 (+0.2%) 🔴
binding-base-ui-vite gzip 63,514 63,633 +119 (+0.2%) 🔴
binding-base-ui-vite brotli 55,189 55,312 +123 (+0.2%) 🔴
binding-base-ui-esbuild raw 217,053 217,495 +442 (+0.2%) 🔴
binding-base-ui-esbuild gzip 70,453 70,562 +109 (+0.2%) 🔴
binding-base-ui-esbuild brotli 61,212 61,359 +147 (+0.2%) 🔴
binding-radix-vite raw 203,589 204,030 +441 (+0.2%) 🔴
binding-radix-vite gzip 64,104 64,226 +122 (+0.2%) 🔴
binding-radix-vite brotli 55,830 55,773 −57 (−0.1%) 🟢
binding-radix-esbuild raw 218,914 219,356 +442 (+0.2%) 🔴
binding-radix-esbuild gzip 71,048 71,162 +114 (+0.2%) 🔴
binding-radix-esbuild brotli 61,721 61,851 +130 (+0.2%) 🔴
binding-mantine-hooks-vite raw 86,765 87,912 +1,147 (+1.3%) 🔴
binding-mantine-hooks-vite gzip 28,562 28,892 +330 (+1.2%) 🔴
binding-mantine-hooks-vite brotli 25,516 25,787 +271 (+1.1%) 🔴
binding-mantine-hooks-esbuild raw 91,148 92,295 +1,147 (+1.3%) 🔴
binding-mantine-hooks-esbuild gzip 30,728 31,100 +372 (+1.2%) 🔴
binding-mantine-hooks-esbuild brotli 27,360 27,665 +305 (+1.1%) 🔴
binding-apollo-client-vite raw 344,009 344,451 +442 (+0.1%) 🔴
binding-apollo-client-vite gzip 105,815 105,943 +128 (+0.1%) 🔴
binding-apollo-client-vite brotli 92,295 92,547 +252 (+0.3%) 🔴
binding-apollo-client-esbuild raw 367,240 367,683 +443 (+0.1%) 🔴
binding-apollo-client-esbuild gzip 116,790 116,948 +158 (+0.1%) 🔴
binding-apollo-client-esbuild brotli 101,930 102,040 +110 (+0.1%) 🔴
binding-usehooks-ts-vite raw 87,535 88,682 +1,147 (+1.3%) 🔴
binding-usehooks-ts-vite gzip 28,789 29,116 +327 (+1.1%) 🔴
binding-usehooks-ts-vite brotli 25,727 26,030 +303 (+1.2%) 🔴
binding-usehooks-ts-esbuild raw 91,922 93,069 +1,147 (+1.2%) 🔴
binding-usehooks-ts-esbuild gzip 30,978 31,326 +348 (+1.1%) 🔴
binding-usehooks-ts-esbuild brotli 27,658 27,877 +219 (+0.8%) 🔴

45 other measured values are unchanged.

@trueadm
trueadm marked this pull request as ready for review October 8, 2026 19:06
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
octane-website-mcp 54f2356 Commit Preview URL

Branch Preview URL
Oct 08 2026, 08:18 PM

trueadm and others added 2 commits October 8, 2026 20:08
A text binding that keeps only its host now calls `setText(null, value,
host)` instead of a new `setOnlyText` export from `octane/internal/client`.
The new import broke builds that only provide the public `octane` entry
(the Rsbuild React-plugin integration and the evals client runtime), and
the wrapper added one production call per update, which the js-framework
work gate counts. setText stays the single text writer, so its journaling,
view-transition marking and call counts are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The React parity lint matches every mountDifferential call's fixture
argument to a top-level preload. The shared steps helper took the fixture
as a parameter, which the lint cannot resolve; each case now mounts its
preloaded fixture constant and hands the pair to the helper.

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

@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 prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Presentation writes miss host-only text
    • The presentationWrite setText handler now forwards args[2] (the host) to the deferred writer and uses it as the Map tracking target when args[0] is null, preventing nodeValue from being assigned on null.

Create PR

Or push these changes by commenting:

@cursor push 97f022d270
Preview (97f022d270)
diff --git a/packages/octane/src/runtime.ts b/packages/octane/src/runtime.ts
--- a/packages/octane/src/runtime.ts
+++ b/packages/octane/src/runtime.ts
@@ -24469,7 +24469,8 @@
 	if (kind === 'bindSignalText') return preparePresentationSignalBinding(args, frame, true) as T;
 	if (kind === 'setText') {
 		const text = coerceText(args[1]);
-		preparePresentationOperation(frame, args[0], 'text', () => writer(args[0], text));
+		const host = args[2];
+		preparePresentationOperation(frame, args[0] ?? host, 'text', () => writer(args[0], text, host));
 		return undefined as T;
 	}
 	if (kind === 'bindSignalAttribute') return preparePresentationSignalBinding(args, frame) as T;

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit 063ee74. Configure here.

Comment thread packages/octane/src/runtime.ts Resolved
trueadm and others added 2 commits October 8, 2026 20:20
presentationWrite's setText branch keyed the prepared write by its first
argument and dropped the rest, so a host-only text binding's
`setText(null, value, host)` would have prepared a write against `null`.
Key it by the host when no Text is passed, and pass the host on to the
deferred write so the page-translation repair applies there too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
octane-website 54f2356 Commit Preview URL

Branch Preview URL
Oct 08 2026, 08:16 PM

@trueadm
trueadm merged commit a7ae419 into main Oct 8, 2026
55 of 59 checks passed
@trueadm
trueadm deleted the fix/translated-only-child-text branch October 8, 2026 20:49
@github-actions github-actions Bot mentioned this pull request Oct 8, 2026
trueadm added a commit that referenced this pull request Oct 9, 2026
…udit (#1943)

#1915 renamed setText's text node to `target` and wrapped its journal
call, so contracts.mjs's exact-string instrumentation found no match and
the root-transactions audit threw before measuring anything. Match the
call with a pattern that accepts any spelling of the staged-view read, so
the pending ternary form in #1942 keeps matching too.

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