[w3c/push-api] What is a push subscription associated with? (Issue #384)

I was trying to make sense of `subscribe()` but it did something unexpected. It looks at a service worker registration's active worker and uses that to obtain a push subscription. However, very early on in this document we have this description:

> Each [push subscription](https://w3c.github.io/push-api/#dfn-push-subscription) is associated with a [service worker registration](https://www.w3.org/TR/service-workers/#dfn-service-worker-registration) and a [service worker registration](https://www.w3.org/TR/service-workers/#dfn-service-worker-registration) has at most one [push subscription](https://w3c.github.io/push-api/#dfn-push-subscription).

What gives?

It does seem like rejection when there's no active worker is intentional: https://github.com/w3c/push-api/pull/230.

It also seems to me that a push subscription is not stored with a service worker as you should be able to replace the service worker and retain the subscription.

There's also some weirdness around "having" a push subscription apparently being known information but "getting" the push subscription requiring a "request" (whatever that is).

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/push-api/issues/384
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/push-api/issues/384@github.com>

Received on Wednesday, 17 July 2024 13:34:30 UTC