[aerogear-dev] Mozilla API Alignment for SimplePush

Kris Borchers kris at redhat.com
Wed Aug 28 10:12:36 EDT 2013


As I work more and more toward aligning with the API spec laid out by Mozilla for SimplePush, I find myself needing to make a major change to the way we have implemented channel registrations. Basically what I have found is that our storage and reuse of channels between app restart/refresh, though meant to be an improvement to performance, is causing more issues than it's solving.

The Proposal
I would like to only persist the user agent id (UAID) in storage and only keep the channel registrations in memory while the app is running. Each time the app starts up, the workflow would be:

First Start
Client Hello => Server
Server Ack => Client
Client 1 or more channel registrations => Server
Server stores channel and sends pushEndpoint => Client
Client registers endpont => App Server or UP Server
Push messages abound
Restart / Refresh
Client Hello => Server
Server recognizes UAID and since no channels were included in Hello, all existing channels are removed as per the spec and sends Ack => Client
Client 1 or more channel registrations => Server
Server stores channel and sends pushEndpoint => Client
Client registers endpont => App Server or UP Server
Push messages abound

The only possible downside I see here is there will be slightly more chatter over the network since the registrations will happen every time the app loads. There should be no performance decrease and may see a performance boost since we will be eliminating a number of synchronous calls into localStorage. The main benefit is that this will allow us to almost completely synchronize our API with Mozilla's which would then allow for immediate use of one of our apps as a web app and Firefox OS app with NO modifications.

Any thoughts?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20130828/2f3faedc/attachment-0001.html 


More information about the aerogear-dev mailing list