WICG / background-sync

A design and spec for ServiceWorker-based background synchronization
https://wicg.github.io/background-sync/spec/
Apache License 2.0
639 stars 83 forks source link

Periodic sync: Ignore minimum intervals when the user is on the site? #165

Open jakearchibald opened 4 years ago

jakearchibald commented 4 years ago

Imagine a sync is registered, and due according to its minInterval, but delayed by 2 hours due to either "minimum periodic sync interval for any origin" (+ engagement) or "minimum periodic sync interval across origins".

However, there are pages/iframe open to the sync's origin. At this point, the site can run JS, and make fetches.

It seems better to do the sync now, when there's no privacy impact, and less significant battery impact, than wait 2 hours.

cc @mugdhalakhani @beverloo.

mugdhalakhani commented 4 years ago

The site can do any synchronization outside of the 'periodicsync' event when it has pages/iframes open. Periodic Background Sync aims to facilitate synchronization when the user isn't on the site but has connectivity.

jakearchibald commented 4 years ago

Then maybe https://github.com/WICG/BackgroundSync/issues/164 is the solution instead.

mugdhalakhani commented 4 years ago

Capturing here what we discussed offline. A future version of PBS will likely set a morning and an evening time interval for synchronization, which will make this a non-issue.

Resource usage is less of concern with "minimum periodic sync interval across origins" set appropriately.