0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
query/packages
Shahid Hassan Ansari 5981771abe
fix(query-core): release the retryer once a mutation settles (#11218)
* fix(query-core): release the retryer once a mutation settles

Mutation.execute() never cleared #retryer after settling, so the settled
retryer's promise kept that mutation's result, variables and context
reachable for as long as the MutationCache retained the Mutation. Mirror
the treatment Query.fetch() received in #11163, guarded by an identity
check so a mutation re-executed from a cache callback keeps its own
retryer.

Releasing the retryer alone would change continue(): a settled mutation
no longer has a retryer to continue, so it would fall through to
execute() and run the mutationFn a second time. Both internal callers
filter on state.isPaused and never reach a settled mutation, but
continue() is reachable directly, so the fallback is now gated on the
mutation still being pending -- the same condition execute() already uses
to detect a restored mutation.

Fixes #11216

* test(query-core): assert the settled retryer is actually released

The previous tests only guarded the continue() gating and passed on main
too, so they did not demonstrate the fix. continue() is the only reader
of #retryer outside execute(): while a settled retryer is still held it
hands back that retryer's promise, which resolves with the raw result it
closed over (or rejects with its error). Both new tests fail on main and
pass with the retryer released.

---------

Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
History 2026-08-18 20:59:40 +02:00
..
angular-query-experimental fix: declaration emit (#11224) 2026-08-18 17:48:33 +02:00
angular-query-persist-client chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
eslint-plugin-query chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
lit-query chore: update to ts 7 and move cut-off to 5.6 (#11212) 2026-08-17 22:50:18 +02:00
preact-query fix: declaration emit (#11224) 2026-08-18 17:48:33 +02:00
preact-query-devtools chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
preact-query-persist-client chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
query-async-storage-persister chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
query-broadcast-client-experimental chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
query-codemods fix(tests): disable local coverage instrumentation (#10776) 2026-05-26 17:29:33 +02:00
query-core fix(query-core): release the retryer once a mutation settles (#11218) 2026-08-18 20:59:40 +02:00
query-devtools chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
query-persist-client-core chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
query-sync-storage-persister chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
query-test-utils chore: update to ts 7 and move cut-off to 5.6 (#11212) 2026-08-17 22:50:18 +02:00
react-query fix: declaration emit (#11224) 2026-08-18 17:48:33 +02:00
react-query-devtools chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
react-query-next-experimental chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
react-query-persist-client chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
solid-query fix: declaration emit (#11224) 2026-08-18 17:48:33 +02:00
solid-query-devtools chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
solid-query-persist-client chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
svelte-query fix: declaration emit (#11224) 2026-08-18 17:48:33 +02:00
svelte-query-devtools chore: update to ts 7 and move cut-off to 5.6 (#11212) 2026-08-17 22:50:18 +02:00
svelte-query-persist-client chore: update to ts 7 and move cut-off to 5.6 (#11212) 2026-08-17 22:50:18 +02:00
vue-query fix: declaration emit (#11224) 2026-08-18 17:48:33 +02:00
vue-query-devtools ci: Version Packages (#11094) 2026-07-21 15:00:30 +02:00