background-sync icon indicating copy to clipboard operation
background-sync copied to clipboard

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

Open jakearchibald opened this issue 5 years ago • 3 comments

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.

jakearchibald avatar Dec 05 '19 13:12 jakearchibald

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.

mugdhalakhani avatar Dec 05 '19 13:12 mugdhalakhani

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

jakearchibald avatar Dec 05 '19 14:12 jakearchibald

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.

mugdhalakhani avatar Dec 13 '19 08:12 mugdhalakhani