Re: [w3c/ServiceWorker] async waitUntil microtask issue (#1213)

> Reviewing the other cases again, I'm confused about the current-extension-expired-same-microtask-turn-extra case. Shouldn't it return OK because all the microtasks in the example will be consumed before the dispatch flag is unset?

Per the spec language I think you are right.

Looking at our implementation, we end up removing the "keep alive token" via a microtask:

https://searchfox.org/mozilla-central/source/dom/workers/ServiceWorkerPrivate.cpp#386
https://searchfox.org/mozilla-central/source/dom/workers/ServiceWorkerPrivate.cpp#356

This then means when the next WaitUntil() is called in a later microtask in the same dispatching task the "keep alive token" is gone.

I was thinking maybe we could make it respect the dispatch flag here, but the "keep alive token" is created on another thread.  It would be very difficult to do this in firefox.

What would people think about adding another flag that says "extension promises were added and now all consumed"?  If that flag is set, then we don't allow new extension promises to be added even if we are still dispatching the event.  This might meet our original intent here?

-- 
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/1213#issuecomment-339997969

Received on Friday, 27 October 2017 15:06:40 UTC