🎯 Changes#
Prevent reactive option updates from cancelling and restarting an in-flight refetch when the query key and enabled state remain unchanged.
The Svelte observer subscription callback now runs inside untrack, preventing synchronous result updates from making the subscription effect depend on resolved options.
Added a regression test covering stale infinite-query data, focus refetching, equivalent reactive options, abort signals, and duplicate page requests.
Fixes #11556
✅ Checklist#
🚀 Release Impact#
Summary by CodeRabbit#
Bug Fixes
- Fixed refetch behavior so reactive option updates with unchanged query settings no longer cancel an in-progress refetch.
- Ensured refetched infinite-query pages remain available when focus-triggered refetches occur.
Tests
- Added coverage verifying refetches continue successfully when reactive options retain the same values.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Repository: TanStack/query/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
7f042619-6dca-4b4a-8363-60545fb68fc1📥 Commits
Reviewing files that changed from the base of the PR and between 2a495979b4eefc075fd641bd89a745e99f54a446 and 5e4dae973372f6097d8ddc6fc9aaeb00575cd540.
📒 Files selected for processing (3)
.changeset/quiet-options-refetch.mdpackages/svelte-query/src/createBaseQuery.svelte.tspackages/svelte-query/tests/createInfiniteQuery/createInfiniteQuery.svelte.test.tsIncluded review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
📝 Walkthrough
Walkthrough#
The Svelte query observer now applies result updates without reactive tracking. A regression test verifies that equivalent reactive options do not cancel an in-flight infinite-query refetch. A patch changeset documents the fix.
Changes#
Svelte query refetch continuity
packages/svelte-query/src/createBaseQuery.svelte.tsupdate(createResult())in Svelte’suntrack.packages/svelte-query/tests/createInfiniteQuery/createInfiniteQuery.svelte.test.ts,.changeset/quiet-options-refetch.md[0, 1]. The changeset records a patch release for@tanstack/svelte-query.Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
#11556.createBaseQuery.svelte.tswraps subscription result updates inuntrack, so synchronous result updates do not become dependencies of the subscription effect. The added regr…#11556.✨ 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.
❤️ Share