Repository navigation
Conversation
🦋 Changeset detectedLatest commit: e26a91b The changes in this PR will be included in the next version bump. This PR includes changesets to release 24 packages
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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughWhen the query client changes, ChangesSolid Query client switching
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The client-switch fix directs the query result to the new client’s cache. No actionable merge-blocking risk remains in the reviewed changes. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
🎯 Changes
Fixes #11106.
When the
queryClientpassed touseQuerychanges,useBaseQuerysubscribed before setting the new observer, so the subscription attached to the old observer and the new client's entry never fetched. This swaps the two lines.Tests: the "should refetch query when queryClient changes" test now asserts the new client's data and that the old client was not refetched. In
solid-query-persist-client, "should be able to persist into multiple clients" no longer pinsstatesto length 3, because the new observer subscribing emits extra intermediate states. It now checks the first state, that the hydrated/fetching state appears, and that the last state isqueryFn2's data. The call-count assertions are unchanged.I used an AI assistant (Claude Code) while working on this.
✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request. (Not run. I ran vitest, eslint andtscforsolid-queryandsolid-query-persist-clientinstead, plus prettier on the changed files.)🚀 Release Impact
Summary by CodeRabbit