From 27d626ce19232a43387e9fc9900b80c4c96565e5 Mon Sep 17 00:00:00 2001 From: Matt Falkenhagen Date: Tue, 19 Jun 2018 15:53:10 +0900 Subject: [PATCH] Resolve the skipWaiting() promise after activation completes. The Activate algorithm's final step was to run Update Worker State to make the worker `activated`. However Update Worker State just queues a task to do so. So the task would run after skipWaiting() resolved its promise, which wasn't the intent of the spec. Fixes #1187. --- docs/index.bs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/index.bs b/docs/index.bs index 192f8d50..ecfb31bb 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -2578,7 +2578,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe 1. Run the [=Update Worker State=] algorithm passing |registration|'s [=active worker=] and *redundant* as the arguments. 1. Run the Update Registration State algorithm passing |registration|, "active" and |registration|'s waiting worker as the arguments. 1. Run the Update Registration State algorithm passing |registration|, "waiting" and null as the arguments. - 1. Run the Update Worker State algorithm passing |registration|'s active worker and *activating* as the arguments. + 1. Run the [=Update Worker State=] algorithm passing |registration|'s active worker and *activating* as the arguments. Note: Once an active worker is activating, neither a runtime script error nor a force termination of the active worker prevents the active worker from getting activated. @@ -2604,7 +2604,8 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe 1. *WaitForAsynchronousExtensions*: Wait, [=in parallel=], until |e|'s [=ExtendableEvent/pending promises count=] is zero. 1. Wait for |task| to have executed or been discarded, or the script to have been aborted by the termination of |activeWorker|. 1. Wait for the step labeled *WaitForAsynchronousExtensions* to complete. - 1. Run the Update Worker State algorithm passing |registration|'s active worker and *activated* as the arguments. + 1. Run the [=Update Worker State=] algorithm passing |registration|'s active worker and *activated* as the arguments. + 1. Wait for all the tasks queued by [=Update Worker State=] invoked in this algorithm to have executed.