Skip to content

fix(signals): a corrected guess keeps its action's hold open (#4690) - #4693

Merged
ryansolid merged 2 commits into
nextfrom
tembo/fix-4690
Nov 5, 2026
Merged

ryansolid merged 2 commits into
nextfrom
tembo/fix-4690

Conversation

@ryansolid

Copy link
Copy Markdown
Member

Summary

Fixes #4690, with the scope corrected in the issue's follow-up comment: a tear between effect-only readers and rendered readers, not a flicker a rendered app shows.

An action guesses, yields its write, then calls refresh(source). If a refresh() from outside the action landed under the pending guess, the correction (supersede / dissolveLane in lanes.ts) re-homed the guessed node into the action's hold, keeping the shown guess as the screen's value (F-11, D-34). But nothing kept that hold open on the node's next flight any more; an uncorrected guess does, through guessFlights. A hold only waits on flights a render reader observes. So with nothing rendering the source, the hold landed with the action's write: effects and untracked reads showed the outside re-ask's old answer until the action's own refresh() landed, while rendered readers kept the guess.

moment effect only / untracked (before) rendered readers expected (all readers)
guess pending, outside re-ask landed New New New
write landed, the action's refresh in flight Old New New
the action's refresh landed New New New

Fix (lanes.ts):

  • A shown guess that a correction re-homes into its hold is marked.
  • lanesBlocked keeps that hold open while the marked node is in flight (D-7, D-35: the action's refresh() is the answer the guess waits for). This applies to the hold only; when a lane guesses the node again, its flight blocks the parent as before (A17).
  • endLanes clears the marks when the hold lands.
  • The marks share the existing reverted WeakSet (renamed marked; a lane and a node can't collide), and the check sits behind guessed, so bundles without optimistic code don't change.

A status note is appended to D-34 in RULES-DERIVED.md; no rule text changes.

#4689 (latest() under such a guess answers the re-asked truth) is not part of this PR. It needs a ruling against F-11, which says latest() answers the truth once the slot's own source answers differently.

Public API changes

None.

Size

One row moves: "app: hydrating + every store primitive family", +110 B minified, at 33,398 B brotli (cap 33.42 KB). Every floor and every other scenario is unchanged. The second commit re-records that row (cap = measured brotli + 10 B: 33.42 → 33.41 KB; recorded minified 100,437 → 100,547 B). No floor cap moves, so no Size-Exception is needed. Measured locally over next @ fb672ca with the compiler built from source, as in size.yml.

How did you test this change?

  • packages/signals/tests/optimistic-outside-reask-4690.test.ts (45 tests): five reader kinds (untracked reads, effect only, a bare render effect, a text node under <Loading>, an effect beside that text node) × four sources (createOptimistic, keyed, unkeyed-array and object createOptimisticStore). Each reader is checked at every moment of the issue's table and over its full value history. Without the fix, exactly the effect-only and untracked rows fail (plus a second-guess case); rendered readers pass either way. Disabling the mark clearing or the lane exclusion on its own makes its own tests fail.
  • @solidjs/compiler build, then pnpm build: 30/30 tasks.
  • On the rebased branch: signals 6744 passed / 14 expected fail; solid 926 passed; web 1706 + 2007 + 758 passed across its three configs on Node 24 (.nvmrc), including select-retention.spec.ts.
  • node scripts/size/size.mjs: the gate passes. check-floor-caps.mjs: no cap raised. node scripts/rules-index.mjs --check: current.

Want tembo to make any changes? Add a comment with @tembo and i'll get back to work!

View on Tembo  Review in Tembo  View Agent Settings

ryansolid and others added 2 commits November 5, 2026 11:56
When a refresh() from outside an action landed under a guess the screen showed, the correction re-homed the node into the action's hold, but nothing kept that hold open on the node's next flight, as an uncorrected guess does through guessFlights. A hold waits only on flights a render reader observes, so with nothing rendering the source the hold landed with the action's write: effects and untracked reads showed the re-ask's answer until the action's own refresh() landed, while rendered readers kept the guess (F-11, D-34). Corrected shown guesses are now marked and lanesBlocked keeps their hold open while the node is in flight; endLanes clears the marks at the landing.

Co-authored-by: tembo[bot] <208362400+tembo-io[bot]@users.noreply.github.com>
app: hydrating + every store primitive family: +110 B minified from #4690, measured locally over next @ fb672ca with the in-repo compiler build; cap = measured brotli + 10 B (33.42 -> 33.41 KB), recorded minified 100,437 -> 100,547 B. No floor moves.

Co-authored-by: tembo[bot] <208362400+tembo-io[bot]@users.noreply.github.com>
@tembo tembo Bot added the tembo Pull request created by Tembo label Nov 5, 2026
@changeset-bot

changeset-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ebc7925

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

This PR includes changesets to release 15 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
canvas-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

github-actions Bot commented Nov 5, 2026

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.42 KB 0 B 0 B −98 B 7.43 KB ✅
signals: + createStore 15.09 KB 0 B 0 B 0 B 15.10 KB ✅
signals: + isPending/latest 12.24 KB 0 B 0 B 0 B 12.25 KB ✅
signals: + until/refresh (truth readers, no optimism) 8.04 KB 0 B 0 B −91 B 8.06 KB ✅
app: render + one signal (the simple-app floor) 9.80 KB 0 B 0 B −157 B 9.80 KB ✅
app: hydrating (no stores) with Show/For/Loading/Errored/lazy 19.01 KB 0 B 0 B −7 B 19.05 KB ✅ lazy-page.js 0.04 KB
app: hydrating + every store primitive family 33.40 KB −3 B (−0.0%) +110 B 0 B 33.41 KB ✅ lazy-page.js 0.04 KB
app: CSR with Show/For/Loading/Errored/lazy 13.71 KB 0 B 0 B −7 B 13.73 KB ✅ lazy-page.js 0.04 KB
app: CSR, observe tier (same app on the observe artifacts) 15.45 KB 0 B 0 B −7 B 15.50 KB ✅ lazy-page.js 0.04 KB
app: CSR, observe tier + attribution engine enabled 30.08 KB 0 B 0 B −7 B 30.12 KB ✅ lazy-page.js 0.04 KB
app: compiled floor (one template, one text hole, one delegated click) 9.98 KB 0 B 0 B −194 B 9.98 KB ✅
app: compiled CSR (JSX todo app: spread/merge/omit, events, class/style, keyed For, Show, Loading + lazy, store) 26.65 KB 0 B 0 B 0 B 26.67 KB ✅ stats.js 0.18 KB
app: compiled hydrating (the same JSX todo app through hydrate(), compiled hydratable) 32.93 KB 0 B 0 B 0 B 32.95 KB ✅ stats.js 0.20 KB
frames: eager client consumer (frames client + transport, lazy codec) 11.75 KB 0 B 0 B 0 B 11.77 KB ✅
page: base server components (hydrating + dynamic + frames + sf reference) 34.05 KB 0 B 0 B −7 B 34.11 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.06 KB, trace.js 9.30 KB, wire.js 3.47 KB
page: live server components (base + live/GET + action + isPending/latest) 40.29 KB 0 B 0 B 0 B 40.30 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.06 KB, trace.js 9.27 KB, wire.js 3.47 KB
page: compiled base server components (the base page as JSX: templates with class/style/attributes/events, For/Show; no spread) 35.98 KB 0 B 0 B −7 B 36.00 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, regions.js 1.06 KB, sc-comments.js 0.20 KB, trace.js 9.26 KB, wire.js 3.47 KB
page: compiled live server components (the compiled base page + live/GET + action + isPending/latest) 44.32 KB 0 B 0 B 0 B 44.34 KB ✅ eager (counted): web.js 23.54 KB; assets.js 0.78 KB, decode.js 7.09 KB, regions.js 1.07 KB, sc-comments.js 0.19 KB, trace.js 9.28 KB, wire.js 3.47 KB
page: base + router (base page + @solidjs/router: createRouter, two routes, preload, useNavigate) 41.59 KB 0 B 0 B 0 B 41.60 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.07 KB, server.js 1.03 KB, serverForms.js 3.58 KB, trace.js 9.24 KB, wire.js 3.48 KB
page: live + router (live page + @solidjs/router: createRouter, two routes, preload, useNavigate) 50.08 KB 0 B 0 B 0 B 50.10 KB ✅ eager (counted): client.js 28.75 KB; assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.07 KB, server.js 1.03 KB, serverForms.js 3.30 KB, trace.js 9.27 KB, wire.js 3.49 KB
server: floor (getRequestEvent + isServer) 1.27 KB 0 B 0 B 0 B 1.29 KB ✅
server: renderToString (the server-render floor) 22.86 KB 0 B 0 B 0 B 22.87 KB ✅

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 42098822794

Coverage remained the same at 78.249%

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: 1370
Covered Lines: 1132
Line Coverage: 82.63%
Relevant Branches: 1108
Covered Branches: 807
Branch Coverage: 72.83%
Branches in Coverage %: Yes
Coverage Strength: 30.05 hits per line

💛 - Coveralls

@ryansolid
ryansolid merged commit 4fe7532 into next Nov 5, 2026
8 checks passed
@codspeed

codspeed Bot commented Nov 5, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 2 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 201 untouched benchmarks
⏩ 5 skipped benchmarks1


Comparing tembo/fix-4690 (ebc7925) with next (fb672ca)

Open in CodSpeed

Footnotes

  1. 5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tembo Pull request created by Tembo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants