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

Define behaviour of pushsubscriptionchange in the event of an error #205

Closed
benlast opened this issue Jul 22, 2016 · 1 comment
Closed

Comments

@benlast
Copy link

benlast commented Jul 22, 2016

When I say "the spec", I'm referring to https://w3c.github.io/push-api/#the-pushsubscriptionchange-event.

It's not defined that a pushsubscriptionchange event will be fired when the browser has network connectivity, and of course it's also possible that any given network request may fail for a variety of reasons.

In a pushsubscriptionchange event handler, it may be a common requirement for the service worker to update new subscription details to some application server. It's not clear how to handle the case of a failure in the network upload.

As a suggestion; If the network Promise is included in event.waitUntil, and the Promise rejects, the event may be re-sent to allow the service worker code to retry.

Otherwise, the event handler code must flag that a retry is required, and wait for some opportunity to retry the upload. However, it's not clear what opportunity it will get. Since the spec says that any old subscription is unsubscribed on completion of the pushsubscriptionchange event, no further push events may be expected, and there is no guarantee that there will be any other event (such as install or activate) fired.

@benlast
Copy link
Author

benlast commented Oct 31, 2016

I see this is effectively included in Kit Cambridge's response at #132 (comment) so I'm closing this issue.

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