-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What to do when navigator goes offline ? #638
Comments
Yes, that makes total sense. I thought it was already kind of like that. |
The merged PR was for the app being in the background via the Page Visibility API, not for going offline (which is a bit hairy, because navigator.online is not exactly the most reliable Web API). |
ah but we're already detecting that, and reducing sync.numThreads from 5 to 1 in that case. It would be a one-liner to also switch to the background sync interval in that case (and maybe rename it because it would then be "background or offline" |
We could also just alias the property and have a nice name in both cases. |
When navigator goes offline, sync request fails, emit an error message, and then try again to sync, until it works.
This seems reasonable, but if the error are logged, this may result in lot of log messages.
I got around this issue by calling
stopSync()
when navigator goes offline, and not logging errors when offline, but I wonder if we shouldn't wait a little bit before trying again to sync on network failure. Wait 5s, then 10s… 60s.The text was updated successfully, but these errors were encountered: