Repository navigation
fix: preserve keyed rows across @empty root rollback - #986
Merged
domgan-oai merged 1 commit intoSep 7, 2026
Merged
Conversation
domgan-oai
marked this pull request as ready for review
September 7, 2026 22:29
This was referenced Sep 7, 2026
14 of 21 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@empty, refills it, and then suspends in the same drain.Why
The
@emptyarm borrows the list's markers. Its parked DOM range could include rows that an earlier render window had already parked. A root rollback then restored those rows and removed them a second time while disposing the empty arm. Filtering that overlap also requires the inner rollback to leave earlier retired rows connected until the outer attempt settles.Changes
.tsrxregressions for multi-node rows, 1,000 inert owned rows, subsequent keyed insertion, effects, and connected cleanup on a nested fallback commit.octanepatch changeset.Validation
main: both row lists vanish during the root hold; subsequent insertion raisesNotFoundError..tsrxfixtures against the candidate: row identity, ordering, cleanup, nested fallback commit, and hydrated adoption pass.git diff --check; esbuild TypeScript parse.71b8e29f: all four Node test shards, four React parity shards, Chromium integration, lint, typecheck, package validation, examples, and provenance.pnpm syncand pinned Vitest/typecheck could not start: frozen install returned 403 for@tsrx/[email protected]. The pinned-toolchain CI above passed.Risk / follow-ups
The rare
@emptyswap and rollback paths scan previously parked rows and certified retired hosts. Ordinary row parking retains its unfiltered node loop. The browser benchmark suite does not isolate this same-drain rollback, so no timing claim is made.Fixes #984.
Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Touches root-transaction parking and keyed
@for/@emptyrollback in the runtime DOM reconciler; scope is a rare suspense/hold path but incorrect behavior could corrupt list DOM or lifecycle timing.Overview
Fixes a root-render hold where clearing a keyed
@for, mounting@empty, refilling the list, and suspending in the same drain could drop or double-remove row DOM on rollback.parkItemForHoldnow accepts the owning list and, for@empty, parks only nodes that belong to the empty arm—not rows already retired or parked for that slot (because@emptyshares the list’s marker range).retainedForSlotNodescollects those earlier parked nodes and inert hosts from bulk owned-list clears. List snapshot restore reuses inert single-marker rows without requiring a parked range, and treats those retained nodes as “keep connected” during orphan sweeps so nested rollbacks don’t reorder or detach rows owned by an outer attempt.Adds Vitest coverage for same-drain empty→refill→suspend (multi-node rows, 1k-item lists, keyed insert reuse) and nested Suspense commit with connected layout cleanups. Patch changeset for
octane.Reviewed by Cursor Bugbot for commit 71b8e29. Bugbot is set up for automated code reviews on this repo. Configure here.