HomePhabricator
Diffusion Comm bee39ec012b7

[identity] Allow register_primary_device() to overwrite device list

Description

[identity] Allow register_primary_device() to overwrite device list

Summary:
The register_primary_device() is used during primary device registration. It makes sure previous device list doesn't exist (user is new).
It can be easily reused for backup restore protocol (we also register new primary device here), but this function must accept previous device lists
as long as lastPrimarySignature is provided (always true in case of backup restore protocol).

Depends on D13223

Test Plan:
Similiar to the test plan from D13222. Tried registering primary device (calling this func manually):

  • Passed for the first time (no previous device list)
  • Failed for the second time (still singleton list, but with different primary device ID)
  • Second case passed when provided lastPrimarySignature

Reviewers: varun, kamil, will

Reviewed By: kamil

Subscribers: ashoat, tomek

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

Details