Page MenuHomePhabricator

Implement route from MessageData to MessageInfo on the client
ClosedPublic

Authored by marcin on Jun 18 2024, 5:08 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 19, 6:48 AM
Unknown Object (File)
Thu, Dec 19, 6:48 AM
Unknown Object (File)
Thu, Dec 19, 6:48 AM
Unknown Object (File)
Thu, Dec 19, 6:48 AM
Unknown Object (File)
Thu, Dec 19, 6:48 AM
Unknown Object (File)
Thu, Dec 19, 6:48 AM
Unknown Object (File)
Thu, Dec 19, 6:48 AM
Unknown Object (File)
Thu, Dec 19, 6:48 AM
Subscribers

Details

Summary

This differential mimics the keyserver logic for getting from MessageData to MessageInfo on the client

Test Plan
  1. Flow
  2. Next diff will enable testing this one more thoruoghly.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lib/push/send-utils.js
47 ↗(On Diff #41450)

This function just replaces enum constant used on identity with relevant string constant used on the client.

74 ↗(On Diff #41450)

This loop groups messages by threads.

96 ↗(On Diff #41450)

This loop gets information about devices of recipient for each thread.

138 ↗(On Diff #41450)

This for loop is a duplication of what we have on the kesyerver. I will make sure to extract it before landing. This loop groups RawMessageInfo objects into those generation rescind (in practice just reaction messages) and those generating notifications.

Harbormaster returned this revision to the author for changes because remote builds failed.Jun 18 2024, 5:21 AM
Harbormaster failed remote builds in B29743: Diff 41450!
  1. Fix CI
  2. Extract generateNotifUserInfoPromise logic and share it between all platforms
lib/push/send-utils.js
57 ↗(On Diff #41452)

Just copy paste from keyserver modified to support different device array in return type.

150 ↗(On Diff #41452)

Get mapping from threadID to related messageInfos. MessageInfos are created from MessageDatas by adding local id or uuid if there is no local id/ @ashoat requested to do so in our 1:1.

172 ↗(On Diff #41452)

Here we get mapping from recipient userIDs to related threadIDs and their devices.

kamil added inline comments.
lib/push/send-utils.js
56–64 ↗(On Diff #41564)

this is too many params, can you update this to be an object?

This revision is now accepted and ready to land.Jun 27 2024, 4:49 AM

Extract parameters to object