background sync react query

Hi everyone. Lately I have been searching for an optimal solution regarding on having a full offline experience in a matter of having the service worker responsible to handle the background sync for the error mutations.

I have read how to use react query offline through the documentation but I would like to move some of the retry logic to the service worker by using the workbox-background-sync.

The problem with this approach is to found a correct relation between the service worker and the react query for the case when the background sync retries successfully a previous error mutation. How can I notify react query that the information that lives on cache with a pending status (for example) is now synced with the API?

Is there anyone around that tried this solution? How people are dealing with this kind of scenario?

Thanks in advance.
Was this page helpful?