0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-18 19:33:22 +00:00
query/.changeset
Maksym Lyskov 05d9b6a40b
fix(query-core): unpause a mutation that can start after its onMutate (#11788)
* fix(query-core): unpause a mutation that can start after its onMutate

Mutation.execute() computes isPaused before it awaits the MutationCache and
mutation onMutate callbacks, and dispatches pending with that value. When the
mutation cannot start at that point (queued behind another mutation in its
scope, or offline) but can by the time onMutate resolves, retryer.start()
runs it directly instead of going through pause(), so no continue action is
dispatched and the mutation reports isPaused: true for its whole request.
defaultShouldDehydrateMutation and resumePausedMutations read that flag, so
the in-flight mutation is dehydrated as not yet sent and runs a second time
after a restore.

Dispatch continue right before start() when the mutation is still marked
paused but can start now, as #9015 does for a restored mutation.

Source: packages/query-core/src/mutation.ts execute(),
packages/query-core/src/retryer.ts start(), hydration.ts
defaultShouldDehydrateMutation.

* test(query-core): use createKey in mutation regression test

---------

Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
History 2026-11-01 15:13:14 +01:00
..
activity-reveal-current-key.md fix({react,preact}-query): set the observer options before subscribing (#12230) 2026-11-01 12:12:24 +01:00
config.json ci: update to changesets v3 (#11583) 2026-09-23 07:12:56 +10:00
fix-add-to-end-max-cap.md fix(query-core): addToEnd caps result to max when items already exceeds max (#10969) 2026-11-01 13:10:27 +01:00
paused-refetch-unhandled-rejection.md fix(query-core): handle the rejection of paused refetches in 'refetchQueries' with 'throwOnError' (#12442) 2026-11-01 13:49:46 +01:00
query-core-no-dom-void-function.md fix(query-core): use '() => void' instead of DOM-only 'VoidFunction' (#12447) 2026-11-01 12:55:56 +01:00
quiet-points-compare.md fix(query-core): shallowEqualObjects ignores key-set differences when counts match (#10777) 2026-11-01 12:31:11 +01:00
unpause-mutation-after-onmutate.md fix(query-core): unpause a mutation that can start after its onMutate (#11788) 2026-11-01 15:13:14 +01:00