0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
query/packages/query-core
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
..
src fix(query-core): unpause a mutation that can start after its onMutate (#11788) 2026-11-01 15:13:14 +01:00
CHANGELOG.md ci: Version Packages (#12391) 2026-11-01 11:04:19 +01:00
oxlint.config.ts chore(*): pass the root 'settings' to the package oxlint configs, which 'extends' does not inherit (#11941) 2026-10-10 01:39:06 +09:00
package.json ci: Version Packages (#12391) 2026-11-01 11:04:19 +01:00
root.oxlint.config.ts chore: replace eslint with oxlint (#11938) 2026-10-09 16:35:33 +01:00
root.tsdown.config.js chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
tsconfig.json chore(tsconfig.json): narrow 'include' pattern to prevent TS6053 race conditions from tsup bundled config files (#10522) 2026-05-04 03:24:13 +09:00
tsconfig.legacy.json chore: composite monorepo (#8560) 2025-01-27 15:58:10 +01:00
tsconfig.prod.json fix/nodejs timeout (#10325) 2026-03-23 15:58:17 +01:00
tsdown.config.ts chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
vite.config.ts fix(tests): disable local coverage instrumentation (#10776) 2026-05-26 17:29:33 +02:00