[w3c/push-api] Define behaviour of pushsubscriptionchange in the event of an error (#205)

When I say "the spec", I'm referring to [https://w3c.github.io/push-api/#the-pushsubscriptionchange-event](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.


---
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/205

Received on Friday, 22 July 2016 22:11:10 UTC