Skip to content

isPaused stays true when resuming mutations from the cache #8999

Closed
@RaphaelGimenez

Description

@RaphaelGimenez

Describe the bug

Resuming a mutation from the cache does not set isPaused to true.

I suspect that it could come from the this.#retryer?.continue() not being set yet ->
https://github.com/TanStack/query/blob/main/packages/query-core/src/mutation.ts#L156

Your minimal, reproducible example

https://stackblitz.com/github/RaphaelGimenez/tanstackquery-ispaused-issue?file=README.md

Steps to reproduce

The example is running a json server and timeout all !GET request.

  1. Open Stackblitz project, start script is set to preview
  2. Go to Stackblitz port 4173
  3. Toggle online by clicking the following button and delete post
    Image
  4. Mutation is paused
    Image
  5. Refresh the preview -> mutation is resumed but isPaused = true
    Image
  6. Toggle offline / online -> mutation is correctly unpaused
    Image

Expected behavior

Resumed mutations from the persister should correctly set isPaused to false.

How often does this bug happen?

Every time

Screenshots or Videos

Screencast.From.2025-04-11.17-18-41.webm

Platform

  • OS: Fedora
  • Browser: Firefox, Chromium

Tanstack Query adapter

react-query

TanStack Query version

5.72.2

TypeScript version

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions