The steps for resolving the .ready promise contain the following (section 3.4.2):
If registration’s active worker is null, wait until registration’s active worker changes.
Implementers should consider this condition is met when the corresponding registration request >> gets to the step 6 of Activate algorithm.
However, both step 5 and step 6 from Activate algorithm use queues to make changes to the ServiceWorkerRegistration objects and dispatching statechange events.
This may lead to situations where the ready promise is resolved before registration.active is updated.