[push-api] Describe process for subscription updates (#132)

Any time a subscription needs to change, we signal that with the `subscriptionchange` event.  Some of these cases won't be as a result of a break and it would be good to describe how a subscription is seamlessly updated.

I think that the process is simple:
1. Determine that a subscription update is needed for any reason.  This might be expiration of the subscription, or a desire to roll out the old encryption keys (see #55).
2. Create a new subscription with the new parameters, while leaving the old subscription in place.
3. Fire the event as an `ExtendableEvent`.
4. Await the `waitUntil` promise if that was set by the application.
5. Clean up the state from the old subscription.

Note that the new subscription can share properties with the old subscription; but this process is necessary for any change where the application might have to share this information with the application server. Keeping the old information around until the application has confirmed that this has happened means that there won't need to be messages lost.  We might also note that sometimes it can take some time for the update to happen.

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

Received on Wednesday, 25 March 2015 01:02:32 UTC