Skip to content

fix(solid-query): avoid held options reads during cache notifications - #12034

Open
niukanen1 wants to merge 1 commit into
TanStack:solid-query-v6-prefrom
niukanen1:fix/solid-oncacheevent-12031
Open

niukanen1 wants to merge 1 commit into
TanStack:solid-query-v6-prefrom
niukanen1:fix/solid-oncacheevent-12031

Conversation

@niukanen1

Copy link
Copy Markdown

🎯 Changes

Closes #12031.

Disposing a query during a transition landing can notify a sibling whose options memo has no committed value. Reading that memo untracked can throw NotReadyError on Solid 2 rc.14+ and interrupt the landing.

Keep the hash last applied by the options render effect in a plain field and match it alongside the latest computed hash. The observer's mutable options cannot serve as that snapshot because fetching and imperative refetching can advance them before the render effect runs (useBaseQuery's data pull and refetch both call observer.setOptions early).

Verified on solid-js 2.0.0-rc.15: the regression test from the issue fails on the previous code with the NotReadyError stack from the issue and passes with this change, in both development and production conditions. On the locked rc.13 runtime the suite is unaffected - the throwing branch does not exist there, and the full package suite shows the same results with and without this change (the pre-existing test-d type-check failures on this machine are identical in both runs).

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Disposing a query during a transition landing can notify a sibling whose
options memo has no committed value. Reading that memo untracked throws
NotReadyError on Solid 2 rc.14+ and interrupts the landing.

Keep the hash last applied by the options render effect in a plain field
and match it alongside the latest computed hash. The observer's mutable
options cannot serve as that snapshot because fetching and imperative
refetching can advance them before the render effect runs.
@changeset-bot

changeset-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 542eb5c

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

This PR includes changesets to release 3 packages
Name Type
@tanstack/solid-query Patch
@tanstack/solid-query-devtools Patch
@tanstack/solid-query-persist-client 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

@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a3f0f845-15d6-41da-a58e-68342dbb7ade

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

1 participant