While finishing up the Fix PN metadata leak PR, I realized that eventually we’ll want to pass some form of data that will allow us to tie back a Push Notification to the originating Whisper message. Some examples of future issues that will require this data to be sent in the PN:
- Having the action of tapping the PN not only open up the correct chat, but scroll up to the correct point in the conversation, so that the user doesn’t get lost;
- Notifications about previous messages should disappear when chat is opened #3487;
- Push notification is shown but no message received #3467;
- Fetch messages in background when Push Notification is received #3451;
- And basically any other functionality which requires matching a PN with a chat message.
It seems that there’s no reason why we couldn’t start passing this data ASAP, so that we start having a wide installed base so that when these features do get rolled out, the old clients will supply updated clients with the necessary data and things will work seamlessly out of the gate.
Assuming we want to get this rolling, we need to decide what to send as a message ID in the PN payload. Ideally, it won’t compromise privacy/darkness, since PNs already contain sender/receiver pubkeys (something to be fixed soon) and transit through Firebase servers. We also really just need something that helps us locate a message in a certain chat within a certain time window (bi-directional match). With that in mind, we certainly don’t need to send the full message ID, but instead something which still provides a good degree of plausible deniability, even if it requires a small amount of computation/lookup on the receiving device. Some thoughts of what we could use:
- Last 4 bytes of message ID
- Hash of message ID
<<Your suggestion here>>
Thoughts and suggestions welcome. cc @petty, @dustin