-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does accessing ExtendableEvent's extend lifetime promises race? #931
Comments
Remove the unnecessary steps that handled uncaught runtime script errors in the install/activate/fetch event dispatch tasks. (DOM dispatch algorithm takes care of it.) Also, make the related steps be more precise. Fixes #924
Feels like |
F2F:
|
Having discussed with @annevk, I will first have to move the "When dispatching an event e that uses the ExtendableEvent interface" steps to right after the actual (dispatching) actions. I'll define some general wrapper that dispatches the event and run these steps, and make it invoked from Handle Fetch and Handle Functional Events. The OP still should be addressed here. |
@domenic suggested we use a reference count approach over the current promise-copying-and-checking one. Will try to come up with it. |
Introduce Extend Service Worker Lifetime algorithm This replaces the steps that monkeypatched the extension of the service worker's lifetime with an algorithm that is explicitly invoked after the steps that dispatch the extendable events. This also changes to use "create an event" algorithm in DOM spec. This also adds an event as a param to Handle Functional Event. Related issue: #931 (comment).
Addressed #931 (comment): c2a518b. Addressed #931 (comment): 6c1f3fe. |
(1) This changes the approach to unsetting the extendable events' extensions allowed flag. This change introduced a reference count based approach instead of the promise-copying-and-checking approach. (2) This also extends the opportunities of the lifetime extension by allowing calling waitUntil() within microtasks queued by the given promise's Promise.prototype.then callback. Related issues: - #931 (1) - #935 (2) - #1039 (2)
(1) This changes the approach to unsetting the extendable events' extensions allowed flag. This change introduced a reference count based approach instead of the promise-copying-and-checking approach. (2) This also extends the opportunities of the lifetime extension by allowing calling waitUntil() within microtasks queued by the given promise's Promise.prototype.then callback. Related issues: - #931 (1) - #935 (2) - #1039 (2)
@annevk pointed out there can be a race in accessing ExtendableEvent’s extend lifetime promises:
72315b9#commitcomment-18283685
I think it's a fair point as now
e.waitUntil(f)
can be called async.The text was updated successfully, but these errors were encountered: