[w3c/push-api] Should PushManager.subscribe() return the existing subscription or a new one? (#305)

Chrome and Firefox behave as I expected: if a subscription already exists and you call `PushManager.subscribe()`they simply return the existing subscription.

This behavior is stated pretty clearly also on MDN:

> A new push subscription is created if the current service worker does not have an existing subscription.

However I have found that _Opera on Android_ and _Samsung Internet on Android_ create a new subscription, instead of returning the existing one. Is this a bug?

What is the _standard_ behavior? If a subscription already exists, should `PushManager.subscribe()` return the existing subscription or a new one?

I have read the standard and found that point 10.5 for `subscribe` says:

> When the request has been completed, resolve promise with subscription.

So if resolving the promise imply an exit from the next steps, then browsers should simply return the existing subscription. Can you confirm?

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

Received on Saturday, 6 April 2019 10:44:02 UTC