Skip to content

fix(solid-query): keep removed queries out of cache - #11361

Open
nickshiro wants to merge 1 commit into
TanStack:solid-query-v6-prefrom
nickshiro:fix/solid-query-remove-queries
Open

fix(solid-query): keep removed queries out of cache#11361
nickshiro wants to merge 1 commit into
TanStack:solid-query-v6-prefrom
nickshiro:fix/solid-query-remove-queries

Conversation

@nickshiro

Copy link
Copy Markdown

🎯 Changes

FIX #11350.

Prevents an actively observed query from being recreated immediately after the removeQueries() function removes it from the cache. TQuery stores the removed query as a read-only tombstone for fixed read operations. This prevents a situation where reactive cache updates call cache.build() for the same query hash and cause unexpected re-fetch. An explicit re-fetch, a write to the cache, a change to the query key, or change to the QueryClient can result in the query being recreated as expected.

Added a regression test covering both behaviors:

  • removing observed query keeps it out of the cache without another fetch.
  • explicitly refetching recreates the query and updates its data.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.

🚀 Release Impact

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

@coderabbitai

coderabbitai Bot commented Sep 1, 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: Team

Run ID: 896a4c30-467c-4720-8cba-1b220d0b0b3b

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

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.

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