Send visual notifications in the same order as they were encrypted
Summary:
This differential ensure that visual (the ones making an alert) notifications are sent in the same order as they were encrypted with respect to the same
device withing single sendPushNotifs promise resolution. This is achieved by separating notification preparation and notification delivery steps. First
notifications are prepared (constructed and encrypted). This
step is entirely asynchronous. Then encrypted notifications are groupped by device token. In the same group notifications are sent sequentially in order mthcing
encryption order. Different groups are awaited asynchronously.
Test Plan:
- Test that notifications functionality remains unchanged - I sent messages and rescinds between four devices: two webs and two natives (Android and iOS).
- Test that notifications are indeed sent in encryption order for single device - I added console.log to each <platform>Push function to examine whether notifications are sent in the right order based on encryptionOrder field of Targeted<platform>Notification instance.
Reviewers: kamil, michal, ashoat
Reviewed By: ashoat
Subscribers: tomek, wyilio
Differential Revision: https://phab.comm.dev/D9819