Page MenuHomePhabricator

[native_rust_library] implement method to retrieve latest backup info
ClosedPublic

Authored by kamil on Thu, Oct 31, 5:00 AM.
Tags
None
Referenced Files
F3355902: D13837.id45668.diff
Sat, Nov 23, 4:14 PM
F3354138: D13837.id45669.diff
Sat, Nov 23, 12:00 PM
Unknown Object (File)
Fri, Nov 22, 11:56 PM
Unknown Object (File)
Fri, Nov 22, 9:48 PM
Unknown Object (File)
Thu, Nov 21, 7:39 AM
Unknown Object (File)
Thu, Nov 21, 7:39 AM
Unknown Object (File)
Mon, Nov 18, 5:45 PM
Unknown Object (File)
Thu, Nov 14, 10:55 PM
Subscribers

Details

Summary

ENG-6145.

This method will be used to get both backupID and userID.
There is some code duplication but later in the stack other function like retrieve_latest_siwe_backup_data or download_latest_backup_id are deprecated in favour of download_latest_backup_info (I had to somehow split this into diffs to make it easier for a review).
This function will be the main interface to get the backup latest info for both password and wallet users.

Depend on D13836

Test Plan

Tested in D13839

Diff Detail

Repository
rCOMM Comm
Branch
backup-work-4
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Thu, Oct 31, 8:47 AM
kamil edited the test plan for this revision. (Show Details)
bartek added inline comments.
native/native_rust_library/src/backup.rs
300–314 ↗(On Diff #45500)

Nit: alternatively to reduce nesting, but not sure if it's more readable

let siwe_backup_data_result = siwe_backup_msg
  .map(|msg_value| get_siwe_backup_data_from_msg(
      backup_id.clone(),
      siwe_backup_msg_value,
  ))
  .transpose(); // this should now be Result<Option<T>>

let siwe_backup_data = match siwe_backup_data_result {
  Ok(siwe_backup_data) => siwe_backup_data, // should be Option<T>
  Err(err) => {
    string_callback(err, promise_id, "".to_string());
    return;
  }
};
This revision is now accepted and ready to land.Mon, Nov 4, 11:28 PM