Mutations aren't dehydrated when closing tab or navigating away #3330
Unanswered
PabloRomanH
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Are you using the When the user comes back to the page, there are a couple of things you need to do:
I plan on updating the docs for v4 and also include an example. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
So this is my situation: I have an event listener on 'beforeunload' so the frontend can update the backend on the status before the tab is closed (specifically on the time the user spent watching a video). I'm using a mutation to do so.
This works okay when the user is online, as the HTTP call succeeds. However, if the user is offline and the tab is closed or the user navigates away, the HTTP call fails, and the mutation is not dehydrated and persisted, so it's not retried when the user loads the website again, and the mutation is lost.
Is there any way I can get this to work?
Beta Was this translation helpful? Give feedback.
All reactions