The spec's activate algorithm, steps 6-7, state:
- Let matchedClients be a list of service worker clients whose creation URL matches registration’s scope url.
- For each client of matchedClients, queue a task on client’s responsible event loop, using the DOM manipulation task source, to run the following substeps:
- Let readyPromise be client’s global object's ServiceWorkerContainer object’s ready promise.
- If readyPromise is pending, resolve readyPromise with the the result of getting the service worker registration object that represents registration in readyPromise’s relevant settings object.
i.e., when a Service Worker transitions from the waiting to active state, all clients that associated (not necessarily controlled) with the worker's registration should have their ServiceWorkerContainer's ready promise resolved, even if those clients had not requested the ready promise via
navigator.serviceWorker.ready. The current implementation only resolves the ready promise if it had already been asked for.
If this is fixed, subtest "resolve ready before unregistering and reregistering" of the service-workers/service-worker/ready.https.html WPT should pass.