Closed collimarco closed 2 years ago
Yes, the existing subscription should be returned, and Section 10. of the subscribe()
method's algorithm specifies this.
Closing as answered. The spec mandates that the existing subscription should be returned.
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:
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:So if resolving the promise imply an exit from the next steps, then browsers should simply return the existing subscription. Can you confirm?