Page MenuHomePhabricator

[native_rust_library] implement method to retrieve latest backup info
ClosedPublic

Authored by kamil on Oct 31 2024, 5:00 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 21, 11:34 PM
Unknown Object (File)
Sat, Dec 21, 11:34 PM
Unknown Object (File)
Sat, Dec 21, 11:34 PM
Unknown Object (File)
Sat, Dec 21, 11:34 PM
Unknown Object (File)
Sat, Dec 21, 11:33 PM
Unknown Object (File)
Thu, Dec 19, 8:13 AM
Unknown Object (File)
Mon, Dec 16, 10:51 PM
Unknown Object (File)
Sun, Dec 8, 6:39 AM
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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Oct 31 2024, 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.Nov 4 2024, 11:28 PM