0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query. https://tanstack.com/query
  • TypeScript 97.9%
  • JavaScript 1.3%
  • Svelte 0.7%
Find a file
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
.changeset fix(query-core): release the retryer once a mutation settles (#11218) 2026-08-18 20:59:40 +02:00
.github chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
.nx/workflows ci: switch to nxCloudId (#9697) 2025-09-27 12:50:53 +10:00
docs docs(examples): add Next.js App Router optimistic updates example (#10997) 2026-08-18 09:57:04 +02:00
examples docs(examples): add Next.js App Router optimistic updates example (#10997) 2026-08-18 09:57:04 +02:00
integrations fix: declaration emit (#11224) 2026-08-18 17:48:33 +02:00
media docs: use the dynamic README header endpoint (#11136) 2026-08-03 13:43:19 +02:00
packages fix(query-core): release the retryer once a mutation settles (#11218) 2026-08-18 20:59:40 +02:00
scripts chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
.editorconfig Initial commit 2019-09-10 13:22:26 -06:00
.gitattributes chore: force type import (#4202) 2022-09-23 10:55:22 +02:00
.gitignore chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
.npmrc ci: update workspace config (#9671) 2025-09-21 23:26:52 +10:00
.nvmrc chore(.nvmrc): update Node to 'v24.16.0' (Krypton LTS) (#10807) 2026-05-26 17:57:16 +09:00
.prettierignore chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
.size-limit.json chore: size-limit 2025-12-31 10:33:53 +01:00
CONTRIBUTING.md chore: Add AI guidelines to contribution guide (#11213) 2026-08-17 20:14:36 +02:00
eslint.config.js chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
FUNDING.json funding changes 2024-02-15 00:59:57 -07:00
knip.json chore(knip): update '$schema' to 'knip@6' to match the installed major version (#10945) 2026-06-14 22:35:28 +09:00
LICENSE chore: Update outdated LICENSE year (#4266) 2022-10-08 08:01:32 +02:00
nx.json fix: lit produces dist-js which needs to be a prod build output (#10995) 2026-06-27 21:21:47 +02:00
package.json chore: tsup -> tsdown (#11222) 2026-08-18 15:19:43 +02:00
pnpm-lock.yaml fix: declaration emit (#11224) 2026-08-18 17:48:33 +02:00
pnpm-workspace.yaml chore: update pnpm to 11.9.0 (#10978) 2026-06-24 13:46:09 +02:00
prettier.config.js chore: Update to prettier v3.1.0 (#6378) 2023-11-15 14:15:47 +11:00
README.md docs: use the dynamic README header endpoint (#11136) 2026-08-03 13:43:19 +02:00
tsconfig.json fix(vue-devtools): fix style prop type (#10087) 2026-02-11 17:06:18 +01:00

TanStack Query

TanStack Query

An async state management library built to simplify fetching, caching, synchronizing, and updating server state.

  • Protocol‑agnostic fetching (REST, GraphQL, promises, etc.)
  • Caching, refetching, pagination & infinite scroll
  • Mutations, dependent queries & background updates
  • Prefetching, cancellation & React Suspense support

Read the docs →

Get Involved

Partners

CodeRabbit Cloudflare
Query & you?

We're looking for TanStack Query Partners to join our mission! Partner with us to push the boundaries of TanStack Query and build amazing things together.

LET'S CHAT

Explore the TanStack Ecosystem

… and more at TanStack.com »