You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Good catch! What I can promptly think of is to add steps (between step 5.3 and 5.4) that get the ServiceWorkerRegistration object, check its .active, and wait in a jump-to-labeled-step-loop until .active is set with the ServiceWorker for registration's active worker.
Before this change, .ready method was waiting for the change of the
state of the regisration's active worker without being synchronized with
the steps that set the corresponding ServiceWorkerRegistration object's
active ServiceWorker object's state.
This changes both .ready and Activate such that .ready tries to resolve
the ready promise, if pending, and just returns. And Activate resolves
pending ready promises after updating active ServiceWorker object's
state.
Fixes#1011
Before this change, .ready method was waiting for the change of the
state of the regisration's active worker without being synchronized with
the steps that set the corresponding ServiceWorkerRegistration object's
active ServiceWorker object's state.
This changes both .ready and Activate such that .ready tries to resolve
the ready promise, if pending, and just returns. And Activate resolves
pending ready promises after updating active ServiceWorker object's
state.
Fixes#1011.
The steps for resolving the .ready promise contain the following (section 3.4.2):
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.
The text was updated successfully, but these errors were encountered: