[slightlyoff/ServiceWorker] More clarity around waiting for an active worker to finish (#916)

I'm working on a Chrome [bug](https://bugs.chromium.org/p/chromium/issues/detail?id=616331) where we're immediately terminating the incumbent worker during activation instead of waiting for it to finish its "in-progress requests" as the spec says. Since update occurs soon after page load, with skipWaiting() we run into this issue in the wild.

I'm wondering though, what exactly is a "request". Is this referring to fetch event only or is it also intended to mean functional events?

Elsewhere the spec also mentions "in-flight requests" which are "triggered by" a worker, which seems a different thing that "in-progress requests" being handled by a worker. 

The spec also doesn't really mention what to do with new incoming requests: do they go to the incumbent worker or the soon-to-be activating worker?

My current plan is to:
- Wait for all events already dispatched to the incumbent worker to finish (subject to our usual timeout)
- All new events are put on hold until the soon-to-be activating worker is activated

How does Firefox deal with this issue?

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/916

Received on Friday, 17 June 2016 08:47:46 UTC