We could use primary key (indexed out of the box) as an ID that we can sort on, we just need to make sure [ {{findAllDeviceTokenForVariantIDByCriteria}} |https://github.com/aerogear/aerogear-unifiedpush-server/blob/1.1.0-beta.2/push/sender/src/main/java/org/jboss/aerogear/unifiedpush/message/TokenLoader.java#L113] does not return duplicates, i.e. we need to make sure that there can't be more than one deviceToken stored for given variantID (I believe that's what we have now, just checking).
Btw on related note, we should make sure that one device is not registered in more than one variant for given app, since then the user would get the message twice as well (but that's something we should probably leave up to app developer?)
|