Page MenuHomePhabricator

[native] implement `GetDeviceListsForUsers` RPC in `native_rust_library`
ClosedPublic

Authored by kamil on Mon, Apr 29, 7:25 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 7, 6:31 AM
Unknown Object (File)
Mon, May 6, 10:08 PM
Unknown Object (File)
Mon, May 6, 2:56 PM
Unknown Object (File)
Sun, May 5, 11:58 AM
Unknown Object (File)
Sun, May 5, 9:36 AM
Unknown Object (File)
Sat, May 4, 2:22 PM
Unknown Object (File)
Fri, May 3, 8:22 PM
Unknown Object (File)
Tue, Apr 30, 1:05 AM
Subscribers

Details

Summary

Added client method calling the RPC to native rust library, exposed it to C++.

Test Plan

Tested in D11834

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Mon, Apr 29, 8:50 AM
tomek added inline comments.
native/native_rust_library/src/identity/device_list.rs
74–101 ↗(On Diff #39657)

Why do we need two separate endpoints? It seems like get_device_list_for_user_helper should be a special case of get_device_lists_for_users_helper.

116 ↗(On Diff #39657)

There's a difference between this API and get_device_list_for_user - only in one of them we're using since_timestamp. Do we know why is that? @bartek

This revision is now accepted and ready to land.Tue, Apr 30, 1:40 AM

Discussed this in the office with @tomek and going to land this, we can continue the discussion when @bartek is back but this code is only a wrapper to already landed D11570.
When we decide to make changes we'd need to update protos so then we can also update the code here.

native/native_rust_library/src/identity/device_list.rs
74–101 ↗(On Diff #39657)

These are different endpoints so it should be the way it is done in this diff

116 ↗(On Diff #39657)
  • GetDeviceList_[History]_ForUser - this is for fetching single user's device list history since given timestamp. It's used for device list verification when receiving an update from peer.
  • GetDeviceListsForUsers (introduced here) - fetches only latest device list for multiple users. Used in the initial migration to peer list, to avoid calling the former RPC in a loop for hundreds of users

https://linear.app/comm/issue/ENG-7591/add-rpc-for-fetching-devicelists-for-multiple-users