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
F3256088: D12463.id41559.diff
Fri, Nov 15, 8:37 PM
F3253550: D12463.id41564.diff
Fri, Nov 15, 7:11 PM
F3253548: D12463.id42017.diff
Fri, Nov 15, 7:11 PM
F3253540: D12463.id42031.diff
Fri, Nov 15, 7:09 PM
Unknown Object (File)
Wed, Nov 13, 3:41 AM
Unknown Object (File)
Fri, Nov 1, 6:43 PM
Unknown Object (File)
Oct 14 2024, 4:18 PM
Unknown Object (File)
Oct 14 2024, 4:13 PM
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
No Lint Coverage
Unit
No Test Coverage

Event Timeline

lib/push/send-utils.js
47

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

74

This loop groups messages by threads.

96

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

138

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