Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Intent to implement: One-off Background Sync API

211 views
Skip to first unread message

Fernando Jiménez Moreno

unread,
Dec 22, 2015, 5:36:00 AM12/22/15
to dev-pl...@lists.mozilla.org
Summary

A ServiceWorker onsync event that can be registered for from a main-frame document or service worker with a main-frame client. Once registered, the onsync event will fire when next online (even after the page or browser has closed). The event doesn’t finish until either five minutes have passed, the event completes without a waitUntil, or the waitUntil rejects/resolves. If the event fails, the browser will retry (exponential backoff) up to a total of five attempts.

Motivation

Web Applications often run in environments with unreliable networks (e.g., mobile phones) and unknown lifetimes (the browser might be killed or the user might navigate away). This makes it difficult to synchronize client data from web apps (such as photo uploads, document changes, or composed emails) with servers. If the browser closes or the user navigates away before synchronization can complete, the app must wait until the user revisits the page to try again. This specification provides a new onsync service worker <https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-concept> event which can fire in the background <https://wicg.github.io/BackgroundSync/spec/#in-the-background> so that synchronization attempts can continue despite adverse conditions when initially requested. This API is intended to reduce the time between content creation and content synchronization with the server.

Bug

https://bugzilla.mozilla.org/show_bug.cgi?id=1217544 <https://bugzilla.mozilla.org/show_bug.cgi?id=1217544>

Link to standard

https://wicg.github.io/BackgroundSync/spec/ <https://wicg.github.io/BackgroundSync/spec/>

Platform coverage

Desktop, Android, Firefox OS.

State in other UAs

Already implemented on Chrome, unclear on the others.

Preference behind which this will be implemented

dom.background.sync.enabled

Cheers,

/ Fernando
Message has been deleted

Ms2ger

unread,
Dec 22, 2015, 8:53:59 AM12/22/15
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/22/2015 11:44 AM, Fernando Jiménez Moreno wrote:
> Summary
>
> A ServiceWorker onsync event that can be registered for from a
> main-frame document or service worker with a main-frame client.
> Once registered, the onsync event will fire when next online (even
> after the page or browser has closed). The event doesn’t finish
> until either five minutes have passed, the event completes without
> a waitUntil, or the waitUntil rejects/resolves. If the event fails,
> the browser will retry (exponential backoff) up to a total of five
> attempts.
>

Any cross-browser tests?

Thanks
Ms2ger
-----BEGIN PGP SIGNATURE-----

iQEcBAEBAgAGBQJWeVXqAAoJEOXgvIL+s8n2VEUH/RGmF1sIklJk0A+1LfBWOztr
A13g03RDkVuSZHhq+ed+bWCosTuMgr13YpgeC6yU9MCvzp8J516slbi6cFDcmEG8
hVATx+EtIT4zWm2hYuzLZT6EhGuboZrWLTy+NL2frta4v1jYBHJ+aAYJ+G/4jsYP
dclhkSDQV+aLYodHCYxtEfR++tG/vkcFTTihLZS/aWJ/KYjCn69SLvc8UPacWEXc
hRAfeR/kbp2GyfkFnagoXN6aADje/Ts0NHFTfBpAQFpycYZ6JetQrlnmGeMYL5w7
vn4e/xa4KPLMYiPBT+IB1xa1BgFOVNXvPEpH0wKB8e0j/9Y4TJuiwcWULo8LMb8=
=aqIw
-----END PGP SIGNATURE-----
0 new messages