0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
query/packages
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
..
angular-query-experimental ci: Version Packages (#12391) 2026-11-01 11:04:19 +01:00
angular-query-persist-client test(*): rename the 'queryKey' test helper to 'createKey' since it creates keys for both queries and mutations (#12293) 2026-10-23 15:32:13 +09:00
eslint-plugin-query ci: Version Packages (#12391) 2026-11-01 11:04:19 +01:00
lit-query chore(integrations): group by adapter and rename packages to '@tanstack/query-integration-<adapter>-<name>' to match examples (#12475) 2026-11-01 20:19:41 +09:00
preact-query fix({react,preact}-query): set the observer options before subscribing (#12230) 2026-11-01 12:12:24 +01:00
preact-query-devtools ci: Version Packages (#12391) 2026-11-01 11:04:19 +01:00
preact-query-persist-client ci: Version Packages (#12391) 2026-11-01 11:04:19 +01:00
query-async-storage-persister ci: Version Packages (#12391) 2026-11-01 11:04:19 +01:00
query-broadcast-client-experimental ci: Version Packages (#12391) 2026-11-01 11:04:19 +01:00
query-codemods test(query-codemods): replace 'async' arrow functions without 'await' with 'Promise.resolve' in the fixtures (#12286) 2026-10-23 00:12:02 +09:00
query-core fix(query-core): unpause a mutation that can start after its onMutate (#11788) 2026-11-01 15:13:14 +01:00
query-devtools ci: Version Packages (#12391) 2026-11-01 11:04:19 +01:00
query-persist-client-core ci: Version Packages (#12391) 2026-11-01 11:04:19 +01:00
query-sync-storage-persister ci: Version Packages (#12391) 2026-11-01 11:04:19 +01:00
query-test-utils chore(deps): upgrade vitest to v5 (#12317) 2026-10-24 19:26:03 +01:00
react-query fix({react,preact}-query): set the observer options before subscribing (#12230) 2026-11-01 12:12:24 +01:00
react-query-devtools ci: Version Packages (#12391) 2026-11-01 11:04:19 +01:00
react-query-next-experimental ci: Version Packages (#12391) 2026-11-01 11:04:19 +01:00
react-query-persist-client fix({react,preact}-query): set the observer options before subscribing (#12230) 2026-11-01 12:12:24 +01:00
solid-query ci: Version Packages (#12391) 2026-11-01 11:04:19 +01:00
solid-query-devtools ci: Version Packages (#12391) 2026-11-01 11:04:19 +01:00
solid-query-persist-client ci: Version Packages (#12391) 2026-11-01 11:04:19 +01:00
svelte-query ci: Version Packages (#12391) 2026-11-01 11:04:19 +01:00
svelte-query-devtools ci: Version Packages (#12391) 2026-11-01 11:04:19 +01:00
svelte-query-persist-client ci: Version Packages (#12391) 2026-11-01 11:04:19 +01:00
vue-query ci: Version Packages (#12391) 2026-11-01 11:04:19 +01:00
vue-query-devtools ci: Version Packages (#12391) 2026-11-01 11:04:19 +01:00