Page MenuHomePhabricator

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

Authored by marcin on Tue, Jun 4, 1:26 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 25, 11:21 AM
Unknown Object (File)
Mon, Jun 24, 10:31 PM
Unknown Object (File)
Fri, Jun 21, 9:21 AM
Unknown Object (File)
Fri, Jun 21, 1:47 AM
Unknown Object (File)
Wed, Jun 19, 8:39 PM
Unknown Object (File)
Wed, Jun 19, 12:38 PM
Unknown Object (File)
Wed, Jun 19, 10:35 AM
Unknown Object (File)
Sun, Jun 16, 7:48 AM
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
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

marcin requested review of this revision.Tue, Jun 4, 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.Thu, Jun 6, 12:36 AM