Handling Offline Mutations Persistently Across App Restarts in React Query v5 #7384
Send to my agentDescribe the bug#
When using React Query v5 for data fetching and mutations in a React Native application, there's a common scenario where mutations need to be performed offline and persisted across app restarts.
Your minimal, reproducible example#
i can't share my code sorry ,
Steps to reproduce#
- Initialize a mutation with React Query in a React Native app.
- Go offline and trigger the mutation.
- Kill the app before going back online.
- Restart the app and observe that the mutation has not persisted.
Expected behavior#
When a mutation is triggered while the application is offline, it should be saved in a pending state. Once the app is online, or when the app restarts and regains connectivity, these pending mutations should automatically be retried.
How often does this bug happen?#
None
Screenshots or Videos#
No response
Platform#
android , ios
Tanstack Query adapter#
react-query
TanStack Query version#
^5.28.9
TypeScript version#
^5.1.6
Additional context#
This functionality is crucial for ensuring data integrity and user experience in mobile applications that may frequently lose connection or close unexpectedly.
Please don't file bug reports for things that clearly aren't bugs, but just misunderstandings where you need guidance. We have GitHub Discussions and an active Discord server for these.
you want:
TkDodo closed this
TkDodo added labelsinvalid
Please don't file bug reports for things that clearly aren't bugs, but just misunderstandings where you need guidance. We have GitHub Discussions and an active Discord server for these.
you want:
Thank you I found solution and implement offline in react-query
Sign in to join this conversation.
Please don't close directly give me instructions, how I can resolve the error @TkDodo can you please help me