[ServiceWorker] waitUntil promise for Install/Activate (#675)

The current Install/Activate waits for the settlement of the `waitUntil` promise within the event handler. And it makes the installation/activation fail when the `waitUntil` promise rejects. 

I'm concerned whether this behavior is correct. It seems the `waitUntil`'s sole purpose should be to give the UA a signal to extend the lifetime (i.e. not to determine the success/failure of certain operations.)

Should the following code be considered an installation failure?
```js
oninstall = (e) => {
  e.waitUntil(caches.open("mysite-static").then(cache => { 
  return cache.addAll(['/css/basic.css', '/js/main.js']).then(() => {
    // some error in a post processing.
    throw new Error("err");
  }); 
}));
};
```

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/675

Received on Tuesday, 7 April 2015 05:03:27 UTC