HomePhabricator
Diffusion Comm fd3843532984

[identity] Reorder device list when updated

Description

[identity] Reorder device list when updated

Summary:
Resolves ENG-5841. Each time we update the device list (login/register/logout), we should determine primary device and reorder the list accordingly.

Depends on D10400

Test Plan:
Added unit tests for the reordering function. Also tested manually by:

  1. Register a user (mobile device)
  2. Log in the user on a "web" device
  3. Check database (or call GetDeviceListForUser RPC) - last device list entry has the following order (simplified for brevity): ["ios", "web"]

Now for web-only users:

  1. Register a user (mobile device)
  2. Call logout to remove the device
  3. Login with web - a log is displayed: "No valid primary device found..."
  4. Log in with mobile again. Check database - last device list entry has the following order: ["ios", "web"]. Mobile was added BEFORE web

Reviewers: varun, michal

Reviewed By: michal

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D10404

Details

Provenance
bartekAuthored on Dec 19 2023, 6:14 AM
Reviewer
michal
Differential Revision
D10404: [identity] Reorder device list when updated
Parents
rCOMMf743c9d8f7ed: [identity] Create function to determine primary device
Branches
Unknown
Tags
Unknown