Skip to content
Docs
Changelog

A mutation's feedback no longer waits for a refetch

Thirteen onSuccess handlers on the web and in the native app awaited or returned an invalidation, which kept the spinner on for one more round trip. They start the refetch with void now, and a test reads every onSuccess.

Markdown

  • Fixed: spinners that outlived their mutation. TanStack Query keeps a mutation pending until the promise its onSuccess returns has settled. Starting an import, restoring or purging a trashed file, the three feedback inbox actions, deleting a role and signing out on the web, and sign-in, sign-up, social sign-in and the passkey actions in the native app awaited or returned an invalidation there. Each now shows its toast or navigates first and starts the refetch with void. (#233)
  • A test reads every onSuccess. scripts/no-awaited-invalidation.test.mjs (in pnpm test) fails on an awaited or returned refetch in apps/web/src and apps/mobile/src. A helper declared in the same file is judged by what it does. Five waits are deliberate and allowlisted with a reason: reading the session again before the native app opens on it, an organization switch, and the consent switch, which is not optimistic. See conventions. (#233)
Edit on GitHubDocumentation is in English.
Cookie settings
We use essential cookies to make our app work. With your consent, we also use optional cookies to improve your experience.

Read our Cookie Policy and Privacy Policy.