[push-api] Allow UAs to unsubscribe offline "successfully" (#122)

The [unsubscribe algorithm][1] currently says:
> If it was not possible to access the push service, reject promise with a "NetworkError" exception and terminate these steps.

But it would be a nicer developer experience if unsubscribe were to immediately clear local state* and resolve the promise successfully, then retry automatically to tell the push server about the unsubscription with exponential backoff (which may eventually give up).

This is what UAs must implement anyway if the website unregisters their Service Worker, since that will succeed irrespective of whether the device is offline.

Let's either require this in the spec, or change the language to allow a UA to do this, whilst permitting other UAs to still return NetworkErrors if they prefer that.

*: by clear local state, I mean make sure that `getSubscription()` resolves as `null`, and push messages are no longer delivered to the Service Worker. Until the unregistration is successfully transmitted to the push server, the push server will still consider it valid (which the developer may be able to observe).

[1]: https://w3c.github.io/push-api/#widl-PushSubscription-unsubscribe-Promise-boolean

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/push-api/issues/122

Received on Friday, 6 March 2015 19:13:21 UTC