fix(svelte-query): prevent reactive options from cancelling refetch - #11557
IdrisCelik wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: TanStack/query/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe 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. ChangesSvelte query refetch continuity
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)
✨ 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
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
pnpm run test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit
Bug Fixes
Tests