Re: [w3c/ServiceWorker] Improve handling of extend lifetime promises (#1049)

> Hmm, do you even need to go in parallel/queue a task? It seems like for promises you should be able to just do "upon fulfillment"/"upon rejection".

I don't think we can guarantee the expected sequence by using "upon fulfillment"/"upon rejection" here. This `promise.then` for decreasing the count should be called after all the `promise.then()` functions called during the event dispatch. Either queuing a normal task or explicitly specifying the order of the microtask seems to be needed.

-- 
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/pull/1049#issuecomment-271754504

Received on Wednesday, 11 January 2017 01:46:59 UTC