mirror of
https://github.com/TanStack/query.git
synced 2026-11-16 22:50:20 +00:00
* 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
|
|
|---|---|---|
| .. | ||
| angular-query-experimental | ||
| angular-query-persist-client | ||
| eslint-plugin-query | ||
| lit-query | ||
| preact-query | ||
| preact-query-devtools | ||
| preact-query-persist-client | ||
| query-async-storage-persister | ||
| query-broadcast-client-experimental | ||
| query-codemods | ||
| query-core | ||
| query-devtools | ||
| query-persist-client-core | ||
| query-sync-storage-persister | ||
| query-test-utils | ||
| react-query | ||
| react-query-devtools | ||
| react-query-next-experimental | ||
| react-query-persist-client | ||
| solid-query | ||
| solid-query-devtools | ||
| solid-query-persist-client | ||
| svelte-query | ||
| svelte-query-devtools | ||
| svelte-query-persist-client | ||
| vue-query | ||
| vue-query-devtools | ||