Re: [w3c/ServiceWorker] Should InstallEvent.addRoutes reject if the the install event is not active? (Issue #1743)

tl;dr I should say it is a specification bug.  Thanks for finding it.

We intend to limit the `addRoutes()` to be called within the install handler execution.  That is why we made `addRoutes()` as a member of `InstallEvent` (not a ServiceWorker global scope etc).  However, if there is a path to call it outside of the install event execution, it is a specification bug.  (And, my colleague pointed out that there is a way to call `addRoutes()` by storing it in the global scope and use it outside, which is out of what I thought during the API implementation)

Thanks for the suggestion on `add lifetime promise`.  I could find the usage in `FetchEvent.respondWith(r)`.
I am trying to fix it with https://github.com/w3c/ServiceWorker/pull/1744

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1743#issuecomment-2606231495
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/ServiceWorker/issues/1743/2606231495@github.com>

Received on Wednesday, 22 January 2025 03:54:25 UTC