Repository navigation
fix(query-core): honour the status filter in isMutating/useIsMutating - #12318
praveenganthp wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 2af0cbd 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.
|
| Layer / File(s) | Summary |
|---|---|
Core mutation status filtering packages/query-core/src/queryClient.ts, packages/query-core/src/__tests__/queryClient.test.tsx |
QueryClient.isMutating now preserves a supplied status filter and defaults to pending. Tests check counts for pending, successful, and errored mutations. |
Framework hook status filtering packages/preact-query/src/useMutationState.ts, packages/react-query/src/useMutationState.ts, packages/vue-query/src/useMutationState.ts, packages/react-query/src/__tests__/useMutationState.test.tsx, .changeset/isMutating-honour-status-filter.md |
The three useIsMutating hooks now preserve supplied status filters and default to pending. Documentation, React tests, and a changeset describe or validate this behavior. |
Priority:
Estimated code review effort: 2 (Simple) | ~15 minutes
Change: Bug fix
Suggested reviewers: sukvvon, tkdodo, damianosipiuk
Merge Risk: 
Minimal · up to 2af0c
-
The status-filter change is ready to merge after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description follows the required template, explains the behavior change and motivation, identifies affected packages, documents tests and release impact, and includes the required checklist selections.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 6 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
🎯 Changes
Previously,
QueryClient.isMutatingand frameworkuseIsMutatinghooks unconditionally overwrotestatus: 'pending'onto mutation filters:Even though
filtersacceptsMutationFilters(which supportsstatus?: MutationStatus), passing a customstatusfilter (such as'success','error', or'idle') was silently ignored and overwritten by'pending'.This PR updates
isMutatinganduseIsMutatingacross@tanstack/query-core,@tanstack/react-query,@tanstack/preact-query, and@tanstack/vue-queryso caller-providedstatusfilters are honoured, defaulting to'pending'when omitted:Framework wrappers for solid, svelte, lit, and angular delegate directly to
queryClient.isMutating(filters)under the hood and automatically inherit this fix.@tanstack/query-core,@tanstack/react-query,@tanstack/preact-query, and@tanstack/vue-query.@tanstack/query-coreand@tanstack/react-query.✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit