Skip to content

fix(signals): a cleanup write during a landing no longer strands later transitions (#4089) - #4092

Merged
ryansolid merged 1 commit into
nextfrom
claude/project-thread-zclbh4
Oct 15, 2026
Merged

ryansolid merged 1 commit into
nextfrom
claude/project-thread-zclbh4

Conversation

@ryansolid

Copy link
Copy Markdown
Member

Summary

Fixes #4089.

Before: since rc.14, a signal write from an onCleanup that runs while a transition lands could leave the landed transaction as the next flush's transaction. Every later transition then parked in it and never committed. With @solidjs/router and @tanstack/solid-query, this showed up as a navigation that never finishes.

After: the write lands with the transition, and later transitions commit. The issue's repro prints 2 12 again, as on rc.13.

How: settle removes a transaction from transactions before land commits its nodes. A commit that disposes a re-run memo's old children runs their cleanups. A cleanup that writes a node the landing still holds calls joinFuture(txOf(el)), which sets flushTransaction to the transaction that just left the list. The write already belongs to the landing, because land commits that node right after. So when its commits are done, land clears flushTransaction if it still points at the landing transaction:

if (flushTransaction === u) flushTransaction = null;

This costs +16 B minified, where the guard in joinFuture suggested in the issue costs about +53 B. One rarer case stays uncovered. If a single landing's cleanups first write a node held by another live transaction and then one held by the landing itself, the landing merges into the live transaction. I left that out to keep the core floor's size down.

How did you test this change?

  • New packages/signals/tests/cleanup-write-during-landing-4089.test.ts uses the issue's repro. It fails on next ([1, 11]) and passes with the fix ([2, 12]). A baseline case without the cleanup write still gives [2, 10].
  • The full signals suite passes: 5299 tests.
  • Local size run: the core floor is +16 B minified and stays under its cap.

🤖 Generated with Claude Code

https://claude.ai/code/session_018fTNh1FgQx2WTF5xoxwML1


Generated by Claude Code

…r transitions (#4089)

`settle` removes a landing transaction from `transactions` before `land`
commits its nodes. A commit that disposes a re-run memo's old children runs
their cleanups, and a cleanup that wrote a node the landing still held
joined that transaction (`joinFuture(txOf(el))`): `flushTransaction` became
the dead transaction, the next flush parked in it, and every later
transition held its writes there forever. The write is the landing's own
(`land` commits the node after it), so `land` drops the stale join.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018fTNh1FgQx2WTF5xoxwML1
@changeset-bot

changeset-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fbcf93d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@solidjs/signals Patch
test-integration Patch
@solidjs/web Patch
@solidjs/babel-plugin Patch
@solidjs/compiler Patch
@solidjs/diagnostics Patch
@solidjs/element Patch
@solidjs/h Patch
@solidjs/html Patch
solid-js Patch
@solidjs/universal Patch
board-example Patch
server-dbmon-example Patch
todos-server-example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown

Size (brotli, eager entry chunk)

scenario head vs base minified vs base minified vs recorded cap lazy chunks (not counted)
signals: core floor (createSignal/Memo/Effect/Root/flush) 7.49 KB +8 B (+0.1%) +16 B +16 B 7.50 KB ✅
signals: + createStore 15.00 KB +4 B (+0.0%) +16 B +22 B 15.00 KB ✅
signals: + isPending/latest 9.79 KB +6 B (+0.1%) +16 B +16 B 9.79 KB ✅
signals: + until/refresh (truth readers, no optimism) 8.09 KB −1 B (−0.0%) +16 B +16 B 8.11 KB ✅
app: render + one signal (the simple-app floor) 10.00 KB +3 B (+0.0%) +16 B +16 B 10.01 KB ✅
app: hydrating (no stores) with Show/For/Loading/Errored/lazy 18.16 KB +68 B (+0.4%) +16 B +16 B 18.11 KB ⚠️ over by 49 B, 4 B minified headroom lazy-page.js 0.04 KB
app: hydrating + every store primitive family 29.68 KB −38 B (−0.1%) +16 B +21 B 29.76 KB ✅ lazy-page.js 0.04 KB
app: CSR with Show/For/Loading/Errored/lazy 13.20 KB +6 B (+0.0%) +16 B −38 B 13.20 KB ✅ lazy-page.js 0.04 KB
app: CSR, observe tier (same app on the observe artifacts) 14.77 KB +2 B (+0.0%) +16 B −36 B 14.79 KB ✅ lazy-page.js 0.04 KB
app: CSR, observe tier + attribution engine enabled 29.41 KB +72 B (+0.2%) +16 B −35 B 29.38 KB ⚠️ over by 32 B, 55 B minified headroom lazy-page.js 0.04 KB
app: compiled floor (one template, one text hole, one delegated click) 10.19 KB +13 B (+0.1%) +16 B +16 B 10.21 KB ✅
app: compiled CSR (JSX todo app: spread/merge/omit, events, class/style, keyed For, Show, Loading + lazy, store) 25.91 KB −20 B (−0.1%) +16 B −20 B 25.92 KB ✅ stats.js 0.18 KB
app: compiled hydrating (the same JSX todo app through hydrate(), compiled hydratable) 31.86 KB −31 B (−0.1%) +16 B +22 B 31.89 KB ✅ stats.js 0.20 KB
frames: eager client consumer (frames client + transport, lazy codec) 11.87 KB 0 B 0 B 0 B 11.87 KB ✅
page: base server components (hydrating + dynamic + frames + sf reference) 34.67 KB −77 B (−0.2%) +16 B +16 B 34.33 KB ⚠️ over by 334 B, 4 B minified headroom assets.js 0.78 KB, bind.js 2.54 KB, decode.js 6.23 KB, lazy-page.js 0.04 KB, regions.js 0.80 KB, trace.js 9.04 KB, wire.js 1.35 KB
page: live server components (base + live/GET + action + isPending/latest) 38.50 KB −116 B (−0.3%) +16 B +16 B 38.15 KB ⚠️ over by 358 B, 4 B minified headroom assets.js 0.78 KB, bind.js 2.54 KB, decode.js 6.23 KB, lazy-page.js 0.04 KB, regions.js 0.80 KB, trace.js 9.03 KB, wire.js 1.35 KB
page: compiled base server components (the base page as JSX: templates with class/style/attributes/events, For/Show; no spread) 35.63 KB +39 B (+0.1%) +16 B −964 B 35.66 KB ✅ assets.js 0.78 KB, bind.js 2.54 KB, decode.js 6.23 KB, regions.js 0.80 KB, sc-comments.js 0.20 KB, trace.js 8.97 KB, wire.js 1.35 KB
page: compiled live server components (the compiled base page + live/GET + action + isPending/latest) 41.25 KB +44 B (+0.1%) +16 B −951 B 41.21 KB ⚠️ over by 34 B, 971 B minified headroom eager (counted): web.js 21.73 KB; assets.js 0.78 KB, bind.js 2.55 KB, decode.js 6.23 KB, regions.js 0.79 KB, sc-comments.js 0.19 KB, trace.js 8.99 KB, wire.js 1.35 KB
page: base + router (base page + @solidjs/router: createRouter, two routes, preload, useNavigate) 42.08 KB −22 B (−0.1%) +16 B +16 B 41.79 KB ⚠️ over by 284 B, 4 B minified headroom assets.js 0.78 KB, bind.js 2.56 KB, decode.js 6.23 KB, lazy-page.js 0.04 KB, regions.js 0.80 KB, server.js 1.02 KB, serverForms.js 3.58 KB, trace.js 9.04 KB, wire.js 1.36 KB
page: live + router (live page + @solidjs/router: createRouter, two routes, preload, useNavigate) 47.84 KB −18 B (−0.0%) +16 B +16 B 47.49 KB ⚠️ over by 346 B, 4 B minified headroom eager (counted): client.js 27.91 KB; assets.js 0.78 KB, bind.js 2.56 KB, decode.js 6.23 KB, lazy-page.js 0.04 KB, regions.js 0.81 KB, server.js 1.02 KB, serverForms.js 3.30 KB, trace.js 9.00 KB, wire.js 1.36 KB
server: floor (getRequestEvent + isServer) 1.33 KB 0 B 0 B 0 B 1.34 KB ✅
server: renderToString (the server-render floor) 20.57 KB 0 B 0 B +8 B 20.58 KB ✅

⚠️ Over the brotli cap within the minified allowance (passes)

  • app: hydrating (no stores) with Show/For/Loading/Errored/lazy: over brotli cap by 49 B; minified 53,402 B vs 53,386 B recorded with the cap (+16 B) — 4 B of the 20 B minified allowance left; +16 B minified over this PR's base
  • app: CSR, observe tier + attribution engine enabled: over brotli cap by 32 B; minified 88,295 B vs 88,330 B recorded with the cap (−35 B) — 55 B of the 20 B minified allowance left; +16 B minified over this PR's base
  • page: base server components (hydrating + dynamic + frames + sf reference): over brotli cap by 334 B; minified 106,830 B vs 106,814 B recorded with the cap (+16 B) — 4 B of the 20 B minified allowance left; +16 B minified over this PR's base
  • page: live server components (base + live/GET + action + isPending/latest): over brotli cap by 358 B; minified 119,053 B vs 119,037 B recorded with the cap (+16 B) — 4 B of the 20 B minified allowance left; +16 B minified over this PR's base
  • page: compiled live server components (the compiled base page + live/GET + action + isPending/latest): over brotli cap by 34 B; minified 123,482 B vs 124,433 B recorded with the cap (−951 B) — 971 B of the 20 B minified allowance left; +16 B minified over this PR's base
  • page: base + router (base page + @solidjs/router: createRouter, two routes, preload, useNavigate): over brotli cap by 284 B; minified 130,711 B vs 130,695 B recorded with the cap (+16 B) — 4 B of the 20 B minified allowance left; +16 B minified over this PR's base
  • page: live + router (live page + @solidjs/router: createRouter, two routes, preload, useNavigate): over brotli cap by 346 B; minified 144,249 B vs 144,233 B recorded with the cap (+16 B) — 4 B of the 20 B minified allowance left; +16 B minified over this PR's base

Bundled with Rolldown (what Vite ships), brotli q11, decimal KB. A scenario fails only when it is over its brotli cap and its minified size is more than 20 B over the minified recorded with the cap; over the cap within that allowance is brotli layout noise and passes with a warning. Caps and their recorded minified in scripts/size/scenarios.js; the floor and page caps in floor-caps.json are frozen (lower only, or Size-Exception: in the PR body). npm run ratchet lowers caps per RC; it never raises one (scripts/size/README.md).

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 38706763244

Coverage remained the same at 77.548%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1328
Covered Lines: 1086
Line Coverage: 81.78%
Relevant Branches: 1046
Covered Branches: 755
Branch Coverage: 72.18%
Branches in Coverage %: Yes
Coverage Strength: 27.86 hits per line

💛 - Coveralls

@codspeed

codspeed Bot commented Oct 15, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 2 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

✅ 195 untouched benchmarks


Comparing claude/project-thread-zclbh4 (fbcf93d) with next (d0ba31c)

Open in CodSpeed

@ryansolid
ryansolid merged commit 0b6765f into next Oct 15, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants