Closed Bug 1214772 Opened 4 years ago Closed 4 years ago

Implement .waitUntil() on FetchEvent

Categories

(Core :: DOM: Service Workers, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: bkelly, Assigned: ehsan)

References

Details

(Keywords: dev-doc-complete)

Attachments

(2 files)

FetchEvent now extends ExtendableEvent which gives it a waitUntil() method:

https://github.com/slightlyoff/ServiceWorker/commit/ff93a4630866dcb9080bdf83fa5b82ddfed593a1
Chrome actually implements this already and I see sites needing it all over the place.  I think we need it for v1 because devs are not going to try to feature detect this.
Blocks: ServiceWorkers-v1
No longer blocks: ServiceWorkers-postv1
Assignee: nobody → ehsan
Attachment #8678844 - Flags: review?(bzbarsky)
Attachment #8679063 - Flags: review?(bkelly) → review+
Please also remove mPromise and GetPromise from FetchEvent, these were used to extend the sw's lifetime when calling respondWith. I think respondWith should call waitUntil internally.
(In reply to Cătălin Badea (:catalinb) from comment #4)
> Please also remove mPromise and GetPromise from FetchEvent, these were used
> to extend the sw's lifetime when calling respondWith. I think respondWith
> should call waitUntil internally.

Good point!  Filed bug 1218621.
Comment on attachment 8678844 [details] [diff] [review]
Make FetchEvent inherit from ExtendableEvent

r=me
Attachment #8678844 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/ac8844b56a54
https://hg.mozilla.org/mozilla-central/rev/908842d5007b
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
The FetchEvent page already states that it inherits from ExtendableEvent, but I've added an explicit link to the waitUntil() page, just to be clear:

https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent 

And a note was already added to the release notes:

https://developer.mozilla.org/en-US/Firefox/Releases/44#Service_Workers

So we're all good.
You need to log in before you can comment on or make changes to this bug.