convex client offline behavior?
I see a couple other posts about local first and offline stuff. And I see here that there is at least some form of retry logic when a convex client is offline and trying to make mutations: https://docs.convex.dev/client/react#retries
I specifically have a react native/expo app that will be offline for days at a time. I was hoping to not have to go full local-first architecture depending on the deeper logic and architecture of the convex client. Here are my questions?
- does the convex client keep the queue of mutations in memory (not local storage, or similar on react native)? ie. lost if the app is killed?
- any limitations on the size of that storage? Number of mutations it can queue?
- Will these mutations eventually be ran in order?
- Is there any way to manage the queued mutations, like delete certain ones that may be repetitive?
- What does the isWebSocketConnected https://docs.convex.dev/api/modules/browser#connectionstate here mean. Is it that the socket connection is open and the last ping was acknowledged? How often is the ping over the websocket?
- Do inflight... properties on the above status object mean "sent to server and waiting on response"? Or just that the client has made the request (ie called mutation) and it either hasn't sent the request to the server (queued) or it has sent and we are still waiting on the response?
Anyway, appreciate any details. Love your product BTW!
I'm guessing using the tanstack query integration and this persist plugin may more be my answer (https://tanstack.com/query/latest/docs/framework/react/plugins/persistQueryClient#how-it-works) but also open to hear any other ideas. Thanks!
persistQueryClient | TanStack Query React Docs
This is set of utilities for interacting with "persisters" which save your queryClient for later use. Different persisters can be used to store your client and cache to many different storage layers....
Convex React | Convex Developer Hub
React client library for interacting with your Convex backend
Module: browser | Convex Developer Hub
Tools for accessing Convex in the browser.
1 Reply
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!