Page MenuHomePhabricator

Enable the client to fetch users platform details from identity RPC
ClosedPublic

Authored by marcin on Jun 4 2024, 1:26 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 13, 7:57 PM
Unknown Object (File)
Wed, Nov 13, 7:57 PM
Unknown Object (File)
Wed, Nov 13, 7:57 PM
Unknown Object (File)
Wed, Nov 13, 7:57 PM
Unknown Object (File)
Wed, Nov 13, 12:50 PM
Unknown Object (File)
Tue, Nov 12, 4:54 PM
Unknown Object (File)
Tue, Nov 12, 3:52 PM
Unknown Object (File)
Fri, Nov 1, 2:46 PM
Subscribers

Details

Summary

This differential modifies the way we handle get_device_lists_for_users RPC so that the client extracts users devices platofrm details as well.

Test Plan
  1. Build web and native client. Disable database encryption on native client.
  2. Log in/register on both platforms with two different users. Make those users friends.
  3. Add console.log to peer-llist-hooks to log the result.
  4. Click create initial peer list in TB menu.
  5. Examine logs and ensure that both users have each other in peer list and patform details are correct.
  6. Fetch SQLite content from XCode/Android studio and ensure that platform details of peers are persisted in aux users table in SQLite.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

marcin requested review of this revision.Jun 4 2024, 1:46 AM

Related comment from @ashoat: https://phab.comm.dev/D12272#inline-72196

We should consider if passing PlatformDetails directly as a JSON wouldn't be better here. You wouldn't have to convert it on Rust side

web/grpc/identity-service-client-wrapper.js
561 ↗(On Diff #40922)

Why does this need to be read-only? It's a collection you're building here, so it seems like it should be mutable. When you return it, Flow should be able to implicitly re-cast it to be read-only

If you make the collection mutable here, you should be able to mutate things directly in the forEach below

564 ↗(On Diff #40922)

I don't understand why we use .forEach instead of a for-each loop

  1. Make collection mutable.
  2. Use for loop instead of forEach
web/grpc/identity-service-client-wrapper.js
560–574 ↗(On Diff #40978)

The point of making the collection not mutable is that you can mutate it here instead of creating a new collection on each loop iteration

The inner part can be left as immutable since you never need to mutate it

Make inner collection immutable. Use direct assignment in a for loop.

bartek added inline comments.
native/native_rust_library/src/identity/device_list.rs
145 ↗(On Diff #40985)

Short notation can be used

This revision is now accepted and ready to land.Jun 6 2024, 12:36 AM