No background sync after restarting browser

408 views Asked by At

I am implementing PWA with a service worker, utilizing Background Sync and IndexedDB in uploading images while user is offline.

So it is working! While offline on uploading an image, nativeFile is pushed to IndexedDB and a unique tag is registered for background sync. After bringing up network to online, the background sync called my function to upload the file from indexedDB to server. That happens when my browser is open.

HOWEVER, in the scenario where uploading while being offline. Then restart the browser and go online, no background sync is triggered after opening it.

Is this how supposed background sync will work? only when browser is open? or am I doing something wrong?

0

There are 0 answers