Describe the bug#
If you call .mutate on a mutation hook when offline and you have network mode "online" you get stuck in pending state despite the fact that the mutationFn was never called
Your minimal, reproducible example#
Just look in the steps to reproduce
Steps to reproduce#
- Create a hook with useMutation
- In the query client mutation default options ensure networkMode is "online" (this is default)
- Disconnect from the internet
- Ensure you are using isPending in you UI to show some kind of loading state (e.g for a button)
- Add onClick handler to mutation
Expected behavior#
The pending state should never be true because the mutationFn is never called
How often does this bug happen?#
Every time
Screenshots or Videos#
No response
Platform#
Android WebView
Tanstack Query adapter#
react-query
TanStack Query version#
^5.90.2
TypeScript version#
No response
Additional context#
No response
you also get back
isPaused: true, so this is expected.