Re: [w3c/push-api] Expose pushManager on Navigator (PR #368)

> An issue that we run into, but the existing specification also runs into, is this line in the Service Workers specification:
> 
> > A [service worker registration](https://www.w3.org/TR/service-workers/#dfn-service-worker-registration) of an identical [scope url](https://www.w3.org/TR/service-workers/#dfn-scope-url) when one already exists in the user agent causes the existing [service worker registration](https://www.w3.org/TR/service-workers/#dfn-service-worker-registration) to be replaced.
> 
> But it seems to me it could just as well say that it's being updated in place (or that some state, such as the push subscription, is carried over).

In practice I don't think that sentence in the service worker spec means much. The actual algorithms around registering service workers (i.e. starting with https://w3c.github.io/ServiceWorker/#start-register-algorithm) already update an existing registration in place rather than creating a new one if the scope url matches.

If I understand it correctly, I believe you're proposing introducing a service worker registration that doesn't have any service workers associated with it. That does seem a bit odd to me, although I don't think anything would necessarily break by changing that assumption... I think there might be some subtlety about what should happen when a service worker is later registered at that same scope but installation fails (should that unregister the "/" registration as currently spec'ed, or would we want to go back to having a registration without a service worker?).

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/push-api/pull/368#issuecomment-2234628630
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/push-api/pull/368/c2234628630@github.com>

Received on Wednesday, 17 July 2024 23:17:24 UTC