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

Export "clear registration" #1410

Closed
marcoscaceres opened this issue May 24, 2019 · 7 comments
Closed

Export "clear registration" #1410

marcoscaceres opened this issue May 24, 2019 · 7 comments
Assignees

Comments

@marcoscaceres
Copy link
Member

The Push API tries to call into "Clear Registration", but that algorithm has "no-export" defined on it so that cross reference in the Push API breaks.

Is that algorithm private design or could it be exported? (maybe same with "Try Clear Registration"... seem try might be a safer export?)

@jakearchibald
Copy link
Contributor

Can you give a bit more detail around what you're looking to use this for?

@marcoscaceres
Copy link
Member Author

This is the conformance requirement:

A push subscription is deactivated when its associated service worker registration is unregistered, though a push subscription MAY be deactivated earlier. A push subscription is removed when the clear registration algorithm is run for the service worker registration.

https://w3c.github.io/push-api/#subscription-deactivation

@marcoscaceres
Copy link
Member Author

McPingittypingping (always wanted to say that)

@jakearchibald jakearchibald self-assigned this Jun 7, 2019
@jakearchibald
Copy link
Contributor

Are there steps you need to run if the service worker is unregistered? If so, I'll add a hook in for that.

When a service worker is unregistered, it remains in use by existing pages (not new ones). At what point do you want to deactivate the push subscription? Once the service worker is unregistered, or once all remaining pages using it go away, and the registration becomes completely redundant?

If there aren't any steps you need to run, then it should be taken care of automatically. If you push subscription is a child of the service worker registration, then when the registration can no longer be referenced, neither can the push subscription.

@jakearchibald
Copy link
Contributor

McPingittypingping 😄

@marcoscaceres
Copy link
Member Author

Heh, went on vacation. Back next week. I’ll need to ping the editors to confirm nothing special needs to happen, but if it’s all taken care of automatically on unregister... that’s awesome.

@marcoscaceres
Copy link
Member Author

Closing this, as nothing special needs to happen. I'll change the Push spec so that part of the spec is a note.

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

2 participants