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

I definitely agree this is underspecified. I interpreted that sentence as "it's up to the worker to call `pushManager.subscribe()` again, and send the new details to its app server." Forgetting to handle the event is a footgun, but, even if we resubscribed automatically, the worker would still need to send up the new subscription endpoint and keys.

If I understand your proposal correctly, that's why we'd need to store both subscriptions, until the new one is used for the first time. I think we'd still need an `ExtendableEvent`, though, unless there's another point at which the new details can be sent (the next time the page is reloaded and calls `serviceWorkerRegistration.pushManager.subscribe()`?)

I do have some concerns about this proposal, though:

* The server may decide to drop all subscriptions for a particular browser. We're considering using this as a way to avoid excessive queueing of messages for a browser that's offline. In that case, the old URLs immediately cease to be valid, so there's no opportunity for a grace period.

* The browser may fire `pushsubscriptionchange` for reasons other than a subscription expiring on the server. Currently, Firefox fires this event if the user revokes and then restores permission, or if they visit a site that previously exceeded the background message quota. In that case, the subscription is removed from the server immediately, and might not be restored for some time.

* This incurs additional storage costs on the server, which now needs to maintain two subscriptions for a particular worker, along with state linking the two. In addition, until the worker sends up the new subscription, the app server can't transition to the new one. There should be no reason to retain the older, now invalid subscription URL.

This feels complex, but that's probably because I'm missing a key use case. It sounds like you're primarily concerned about the app failing to resubscribe due to network errors, and leaving the app server unable to send messages. Is that accurate?

+@bbangert @jrconlin

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

Received on Friday, 26 February 2016 19:29:17 UTC