HomePhabricator
Diffusion Comm 0cdb17b3921e

[CommCoreModule][native_rust_library] update downloading User Keys to support…

Description

[CommCoreModule][native_rust_library] update downloading User Keys to support user identifier

Summary:
ENG-6145.

An alternative to this is to pass username and get BackupID from Rust — in terms of network calls, it should be the same. I implemented this because it required a lot fewer changes because it reused existing code.

Alternatively, we can download only backupID and read backupDataKey and backupLogDataKey (it should exist on primary always) to avoid downloading User Keys - but curious about @bartek's perspective as I don't fully remember why it was implemented that way,

  1. Deprecate download_latest_backup_id
  2. Update retrieveBackupKeys to have backupID

Depends on D13847

Test Plan:
This is the final diff in the stack so testing this end-to-end:

  1. iOS and Android (I was using physical devices)
  2. username and wallet user
  3. testing restore similarly to link

Testing secondary device auth:

  1. Added log here to make sure keys are retrieved
  2. Added log on the recipient to make sure those are transferred correctly

Tested password/SIWE user on iOS, when secondary was web or Android - works.

I found a couple of issues with this flow but not related to the backup itself - I am going to list them in ENG-9841.

Reviewers: varun, bartek

Reviewed By: varun, bartek

Subscribers: ashoat, tomek, bartek

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