fix(preact-query): do not go into optimistic fetching state when not subscribed - #11530
RezaRahemtola wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .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 Preact ChangesPreact unsubscribed query handling
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Possibly related PRs
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change confines unsubscribed Preact queries to an idle, non-fetching state and includes coverage for initial and rerendered unsubscribed cases. No actionable merge risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1 unsupported.)
✨ 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
useQuerywithsubscribed: falsein preact-query reportsisFetching: trueon every render even though the observer is never attached andqueryFnis never called.useBaseQueryalways sets_optimisticResults = 'optimistic'regardless of subscribed. React handles this (#10759), as does preact's useQueries (#11130) and this PR applies the same fix to preact'suseBaseQuery, with the test ported from #10759✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit
Bug Fixes
Tests