[push-api] Multiple consecutive messages (#168)

If an application has a bunch of inbound messages, there is no way for it to know whether subsequent and imminent push messages could invalidate that message.  This can result in poor user experience.

The canonical example is where a user is offline with one device but online on another.  The offline device will receive a message for an event, the online device might acknowledge the event, which causes the offline device to receive another message that cancels the first.

However, when the offline device comes online, the first message is delivered first, without context.  Now, we could recommend that the server uses a protocol collapse mechanism (see https://github.com/webpush-wg/webpush-protocol/pull/12).  However, there are still race conditions where this still produces poor UX.  And it doesn't deal with the case where there are multiple messages, all of which you want, that you want to treat collectively in a different fashion as a result of having multiple.

I think that we should consider adding a method to `PushManager` so that applications can peek into the future to avoid this sort of problem.

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

Received on Wednesday, 30 September 2015 22:25:09 UTC