Skip to content

fix(signals): avoid retrying settled errors on dependency checks - #5260

Open
itisrmk wants to merge 1 commit into
solidjs:mainfrom
itisrmk:devin/1795853882-optimistic-failed-read
Open

itisrmk wants to merge 1 commit into
solidjs:mainfrom
itisrmk:devin/1795853882-optimistic-failed-read

Conversation

@itisrmk

@itisrmk itisrmk commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #5195.

Mounting an optimistic row can pull an already-errored memo. The dependency check recomputed that memo merely because its error came from an earlier cycle; its existing upstream reads then retried the failed request and held the row on an unrelated fetch.

Only retry a pending dependency in this check. Dirty computations, tracked re-reads by existing readers, and explicit refreshes retain their retry paths. This preserves the distinction between a new reader and a re-read (F-9), treats an error as an answer (D-41), and avoids observable extra work from a lazy pull (D-22).

Add four DOM tests covering plain and optimistic sources, an unchanged failed source while a new row mounts, and explicit recovery to empty and nonempty lists. Include a patch changeset.

The only cross-referenced PR is merged downstream solidjs/reactivescript#94. It records the Solid bug and its reproduction; it does not fix Solid's runtime. No matching open Solid implementation PR was found.

How did you test this change?

Ran the final four regression/control cases with the implementation fix removed:

Test Files  1 failed (1)
     Tests  2 failed | 2 passed (4)

The failing cases observed an unexpected second b request; the plain-source controls passed. Restored the fix, rebuilt the signals and Solid JS artifacts, then ran:

  • pnpm --filter @solidjs/signals test
Test Files  576 passed (576)
     Tests  7322 passed | 17 expected fail | 2 skipped (7341)
  • pnpm --filter @solidjs/web exec vitest run test/optimistic-failed-read-5195.spec.tsx test/errored-store-memo-boundary-reask-5002.spec.tsx test/for-row-latest-reask-fails-4998.spec.tsx
Test Files  3 passed (3)
     Tests  7 passed (7)
  • pnpm exec prettier --check packages/signals/src/core/core.ts packages/web/test/optimistic-failed-read-5195.spec.tsx .changeset/optimistic-failed-read.md
All matched files use Prettier code style!
  • npm --prefix scripts/size run size
size: every scenario within its cap.

No browser visual verification was performed. The complete web, SSR, hydration, and integration suites were not run.

Public API changes

None. No new exports, parameters, options, or type signatures.

AI assistance

Prepared with AI assistance from Devin (Cognition AI).

@changeset-bot

changeset-bot Bot commented Nov 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a1a69ff

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

@codspeed

codspeed Bot commented Nov 28, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

2 warnings

⚠️ Upgrade your CodSpeed plugin for Node.js 24

@codspeed/* 5.4.0 is only tested on Node.js 18, 20, and 22, so your Node.js 24 measurements may be inaccurate. Upgrade your @codspeed/* packages to 6.0.0 or later.

See affected benchmarks

⚠️ 1 benchmark is 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

✅ 205 untouched benchmarks
⏩ 5 skipped benchmarks1


Comparing itisrmk:devin/1795853882-optimistic-failed-read (a1a69ff) with main (510bb8d)

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[signals] A guess that mounts a row reading a failed createOptimistic re-asks it, and the guess waits for that re-ask

1 participant