You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm trying to implement periodic background sync on a service worker following the steps in this documentation: https://web.dev/periodic-background-sync/
I also installed the demo, but so far I haven't seen the periodicsync event fired not even once.
It does work though if I click "sync manually" or if I trigger the tag from devtools. But it doesn't work periodically.
I've read that browsers can decide when to sync, but I'm not able to reproduce the behaviour in any way.
Is there a bug or am I missing something?
A couple of things that could be useful: I checked the status and it's "granted". I checked the active tags and I can see the one I registered.
I guess I can't simply call a setInterval inside a service worker because it's going to be shut after a while. For the same reason, I guess that a WebSocket wouldn't work either.
The text was updated successfully, but these errors were encountered:
Have you waited between 24-48 hours? For current Chrome implementations, I believe that the periodic background sync is throttled to once per day, but I don't know what time of day that actually happens.
We can follow up with a bug via https://crbug.com/new if it looks like you can't trigger a periodic background sync at all.
Hi, I'm trying to implement periodic background sync on a service worker following the steps in this documentation:
https://web.dev/periodic-background-sync/
I also installed the demo, but so far I haven't seen the periodicsync event fired not even once.
It does work though if I click "sync manually" or if I trigger the tag from devtools. But it doesn't work periodically.
I've read that browsers can decide when to sync, but I'm not able to reproduce the behaviour in any way.
Is there a bug or am I missing something?
A couple of things that could be useful: I checked the status and it's "granted". I checked the active tags and I can see the one I registered.
There are also two questions on StackOverflow (unanswered) about this.
https://stackoverflow.com/questions/66649131/periodic-background-sync-not-working-on-pwa-official-api-demo-broken
https://stackoverflow.com/questions/65096834/periodic-sync-not-fired-in-service-worker
I guess I can't simply call a setInterval inside a service worker because it's going to be shut after a while. For the same reason, I guess that a WebSocket wouldn't work either.
The text was updated successfully, but these errors were encountered: