Page MenuHomePhabricator

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

Authored by kamil on Apr 29 2024, 7:25 AM.
Tags
None
Referenced Files
F3615283: D11832.id39657.diff
Wed, Jan 1, 11:48 AM
F3615282: D11832.id39687.diff
Wed, Jan 1, 11:48 AM
F3615242: D11832.id.diff
Wed, Jan 1, 11:47 AM
Unknown Object (File)
Fri, Dec 20, 10:46 AM
Unknown Object (File)
Nov 17 2024, 11:36 PM
Unknown Object (File)
Nov 12 2024, 12:05 PM
Unknown Object (File)
Nov 12 2024, 11:12 AM
Unknown Object (File)
Nov 12 2024, 9:33 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.Apr 29 2024, 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.Apr 30 2024, 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