Skip to content

fix(signals): skip non-dirty truth retries on active optimistic guesses - #5272

Open
semanym wants to merge 1 commit into
solidjs:mainfrom
semanym:fix/optimistic-guess-mounted-row-updates
Open

semanym wants to merge 1 commit into
solidjs:mainfrom
semanym:fix/optimistic-guess-mounted-row-updates

Conversation

@semanym

@semanym semanym commented Nov 29, 2026

Copy link
Copy Markdown

Summary

Fixes #5201.

When a createOptimistic node (CONFIG_GUESS) has an in-flight refresh on its underlying truth source, it holds _x._error (NotReadyError, STATUS_PENDING) while continuing to present its active optimistic guess. Previously, updateIfNecessary retried any non-dirty node with _x._error && _time < clock && !_x._inFlight, which caused an unrelated flush (for example, checking a shared memo in REACTIVE_CHECK or mounting a reader of the guess) to re-run recompute on the guess node as a mainline truth pass. Reading the held truth source then merged the guess's held transaction into the unrelated flush, violating F-11 and D-33: newly mounted <For> rows stayed staged behind the unresolved hold while their visible owners were disposed, causing subsequent guesses to stop updating attributes on those rows.

This change skips the non-dirty _x._error retry branch in updateIfNecessary when guessing && (el._config & CONFIG_GUESS), so an active guess stands in for its own flight until it is actually dirtied or its lane settles. Non-guess pending memos keep their existing retry behavior, and the guessing guard preserves zero pay-for-use bundle impact (+0 B minified).

Public API changes: None.

How did you test this change?

  • Added unit regression tests in packages/signals/tests/optimistic-guess-mounted-row-5201.test.ts covering both indirect REACTIVE_CHECK checks through shared memos and direct reader mounts during an unrelated flush (verified failing before the fix and passing after).
  • Added the issue DOM reproduction test in packages/web/test/optimistic-guess-mounted-row-5201.spec.tsx (verified failing with [false, false] before the fix and passing with [true, true] after).
  • Ran node packages/signals/scripts/rules-index.mjs --check, full workspace build (pnpm build), full test and typecheck suites across @solidjs/signals (7,324 tests), solid-js (942 tests), and @solidjs/web, Prettier formatting, and the CI bundle-size gate (scripts/size/gate.mjs, +0 B minified).

🤖 Generated with Claude Code

When a CONFIG_GUESS node carries a pending or errored truth pass
(_x._error) from its held source, a non-dirty dependency check in
updateIfNecessary previously fell through to recompute(el) as a
mainline truth pass. Reading the held truth source from an unrelated
flush merged the guess hold into that flush, violating F-11 and D-33
and leaving newly mounted rows staged behind the unresolved hold while
their on-screen owners had already been disposed.

Skip the _x._error retry branch in updateIfNecessary when
guessing && (el._config & CONFIG_GUESS) so the guess stands in for its
own flight until it is actually dirtied or its lane settles.

Fixes solidjs#5201

Co-Authored-By: Claude Code <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Nov 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4a40c00

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

This PR includes changesets to release 5 packages
Name Type
@solidjs/signals Patch
@solidjs/web Patch
@solidjs/diagnostics Patch
solid-js Patch
@solidjs/universal 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

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.

[signals] A row mounted while a guess is held misses a later guess in an attribute, though the memo it reads shows it

1 participant