HomePhabricator
Diffusion Comm f38db4748c74

[CommCoreModule] implement creating User Keys backup

Description

[CommCoreModule] implement creating User Keys backup

Summary:
ENG-9656.

There are several options on how to implement this:

  1. createUserKeysBackup: (backupSecret: string) -> We pass the secret (password or signature), and the SIWE message is read from SQLite. It's definitely the cleanest to use, but for SIWE users we first read the signature from SQLite to pass this again to C++ via JSI to then read the message again from the C++ level.
  2. createUserKeysBackup: (backupSecret: ?string) -> We can pass secret for password users, for SIWE read it directly from SQLite to avoid unnecessarily transferring data (this was pointed by @varun in https://phab.comm.dev/D13847#inline-78286). However, using nullable values raises concerns explained in https://phab.comm.dev/D11715?id=39388#inline-70515.
  3. createUserKeysBackup: (backupSecret: string) and createUserKeysBackupSIWE: () -> having separate JSI calls for SIWE and wallet users doing almost the same, for me it's the least clean, I prefer having one API to work regardless of user type.

I implemented 1, which is not the best in terms of transferring data but it's the cleanest one - but I am open to updating. Note, that this API won't be used a lot.

Depends on D13933

Test Plan: Tested in D13937

Reviewers: bartek, tomek

Reviewed By: bartek

Subscribers: ashoat, varun

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

Details

Provenance
kamilAuthored on Thu, Nov 14, 4:37 AM
Reviewer
bartek
Differential Revision
D13934: [CommCoreModule] implement creating User Keys backup
Parents
rCOMM31151871843e: [CommCoreModule] remove capturing logs
Branches
Unknown
Tags
Unknown