Re: [w3c/ServiceWorker] There should be no such thing as "fail to activate" (#659)

This may be more of a support question, but it seems relevant to the question here (and whether workarounds need to be better documented).

[This Google Developer's page](https://developers.google.com/web/ilt/pwa/live-data-in-the-service-worker#service-workerjs) suggests putting database upgrades within the `activate` handler, but it seems that an inability for `activate` to fail means that one cannot leverage say an IndexedDB upgrade transaction rejecting upon failure so that the upgrade may be tried again automatically at some point or through some `triggerActivate()` mechanism.

Or, as in my case, passing in a message to the `activate` handler--as to indicate which files of my library users to store into IndexedDB for them--becomes problematic: if my file sending the message was no longer present, the `activate` phase would fail without me having any apparent way to trigger an update.

It seems to me that the only solution is either to handle IndexedDB upgrades outside of the service worker (probably the easiest solution), or to I guess unregister and register again.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/659#issuecomment-384919053

Received on Friday, 27 April 2018 09:35:20 UTC