This is a short post today. (By writing that, it'll make it true!) It's also more of a short developer log, rather than having a specific point π
...
For further actions, you may consider blocking this person and/or reporting abuse
From eyeballing your code, that promise passed to the
install
event'swaitUntil()
seems like it might resolve too early (it's not waiting for theuntar()
callback), and also would resolve even if thecache.put()
call rejected.Generally, you'd want to make sure that the promise passed to an
install
event'swaitUntil()
only fulfills iff all of the content that needs to be cached was successfully saved, and rejects otherwise.Rejecting that
waitUntil()
promise will cause the newly registered service worker to enter theredundant
state. The next time the same service worker gets registered, theinstall
process will then run againβand hopefully everything will be properly cached during that subsequent attempt.The call to
untar
in this case is actually totally synchronous so all the callbacks arrive before theasync
handler resolves. I modified the library which did use a Web Worker... anyway, the callback is fairly misleading- I'll fix it up.Gotcha about the callback. But the
cache.put()
part could definitely fail asynchronously, which is not uncommon if you're, for instance, out of storage quota for your origin.I have four versions of the DEV desktop PWA installed π
Awesome! I'm doing something like this using precache manifests for a PWA game I'm developing at rdlr.netlify.com/ (only intended to be visited on mobile) - It's 100% available offline and even has a fun little install screen.
This is awesome πππ