Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New push subscription MUST have an endpoint that's different from the original #357

Open
collimarco opened this issue Dec 2, 2022 · 1 comment

Comments

@collimarco
Copy link

When a push subscription is refreshed, I assume that the new push subscription is a completely different object, with different endpoint and different keys.

Having a guarantee that all subscription fields (endpoint and keys) are immutable, allows an application server that stores the subscriptions in a database to mark the fields as immutable and thus protect the integrity of subscriptions.

I think that the behavior is already correct in the browsers (do you confirm?).
However, you need to clarify the sentence in the standard to make it more explicit:

https://www.w3.org/TR/push-api/#subscription-refreshes

When this happens, the user agent MUST run the steps to create a push subscription given the PushSubscriptionOptions that were provided for creating the current push subscription. The new push subscription MUST have [[an endpoint and a key pair that are]] different from the original subscription.

[[Bold]] is mine, it's the change.

@collimarco
Copy link
Author

Seen from another perspective: if the key pair changes, also the endpoint MUST change. Having the same endpoint, but different keys at different times, would be extremely confusing and error-prone (I don't think that browsers are doing this, but it's better to clarify that in the standard).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant