Skip to content

fix(octane): isolate signals in keyed SSR rows - #1281

Merged
domgan-oai merged 6 commits into
octanejs:mainfrom
openai-oss-forks:codex/fix-inline-row-ssr-signals-1256
Sep 23, 2026
Merged

domgan-oai merged 6 commits into
octanejs:mainfrom
openai-oss-forks:codex/fix-inline-row-ssr-signals-1256

Conversation

@domgan-oai

@domgan-oai domgan-oai commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Signal declarations directly inside keyed @for rows rendered the first row's value in every row during SSR. Give these rows a call-site owner shared by SSR and hydration so first, second stays independent through edits, reordering, nested control fragments, and discovery retries.

Keep child-component identities and reconciliation keys intact. Rows that need an owner use scoped updates, including in production Strong mode. Late query activation retains the same row identity across discovery instead of starting the first query twice.

Fixes #1256.

Validation

  • Observed the inline SSR regression fail before the fix; existing child-component controls passed. Also reproduced the Strong selection collision and duplicate cold query start before correcting them.
  • Scoped formatting and typecheck for the compiler, client/server runtime, and regression suites, including TSRX-aware checking of the provider fixtures.
  • pnpm run changeset:check and pnpm run sync.
  • pnpm run build passed; imports and the production error catalog verified.
  • Streamdown prepack/tarball creation passed using main's loader after conflict resolution, including client/server output, declarations, styles, and built-package checks.
  • Targeted Vitest: 612 tests passed across 21 list/SSR/signal/hydration/island suites on base 8a3a1e7c5, with serial files and at most two workers. The earlier compiler/list/SSR/signal/hydration run passed 674 tests across 20 suites before the subsequent island-only main change.
  • Deterministic SSR gates: 3/3 passed; 23/23 public-entry boundary/export/load targets passed. Behavior-root Vite/esbuild and root-static-local/hooks-state/context raw/gzip/Brotli budgets passed without cap changes.
  • Current-head CI: run 35853631818 passed all 26 jobs on signed merge 94d99543a, including required test (24), lint, and typecheck, plus browser, React parity, example, package/compatibility, and provenance checks. Full pnpm typecheck and pnpm test were not run locally.
  • Current-head Cursor Bugbot review completed (NEUTRAL, one finding). Its child row-fallback finding was resolved as a false positive after source tracing and a focused 106-test rerun: child entry clears active list keys before owner lookup, and discovery uses the same boundary. All review threads are resolved.

The targeted run uses the Octane plugin and per-test setup, serial files, and at most two workers. Coverage includes all five server APIs, dev/production/Strong modes, primitive and opaque keys, DOM adoption, edits/reorder, nested and sibling lists, suspension, conditional fragment cleanup, late handles, query discovery, and owner-carrier restoration. A cold first handle activated during child rendering also preserves separate sibling component cells across rows, hydration, and reordering; potential binding capability stamps child identities before document activation.

Risk / follow-ups

Matched against upstream 8a3a1e7c5 with Node 26.4.0: ordinary client entry +456 raw / +112 gzip bytes; ordinary server entry +71 raw / +19 gzip bytes. The existing 100-row child-component SSR fixture preserves compiled/HTML hashes, 200 frames/envelopes, frame widths 9/14, zero recipe writes/cache appends/key coercions, and 402 used-handle cache writes; its production gzip delta is +131 ordinary / +168 potential bytes. Checked ordinary-app gzip budgets retain 11,309 / 8,456 / 2,193 bytes of headroom.

The client list slot and existing potential SSR row recipe each gain one scalar site field. These fields are outside the SSR frame counters. No shared-host timing or heap claim is made.

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. Autofix is disabled.


Note

Medium Risk
Changes signal instance identity and keyed list SSR/hydration paths; scoped to inline signals in @for but affects core rendering state.

Overview
Fixes SSR and hydration so signal declarations inside keyed @for rows get their own instance identity instead of sharing the first row’s state.

The compiler now detects inline signal/render sites in list bodies and threads a signalSite control key into ssrForItem and client forBlock / keyedForBlock, which turns off fast keyed paths and Strong selection shortcuts when a row needs its own owner. On the server, each row runs under a row-scoped signal owner (with discovery/query observer support); on the client, ForSlot.signalSite drives structural instance keys and lets nested control fragments borrow the row owner without caching it on throwaway scopes. Direct signal binding also skips redundant owner re-entry when the row owner is already active.

Regression coverage expands for inline vs child-component rows, cold query discovery, late handles, Strong selection updates, nested/sibling lists with suspension, and reorder/edit flows.

Reviewed by Cursor Bugbot for commit 94d9954. 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 Sep 23, 2026
@domgan-oai
domgan-oai marked this pull request as ready for review September 23, 2026 09:44

@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.

Comment thread packages/octane/src/runtime.ts Resolved

@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 94d9954. Configure here.

Comment thread packages/octane/src/runtime.server.ts Resolved
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.

SSR repeats the first row signal value for declarations inside keyed @for

1 participant