HomePhabricator
Diffusion Comm 73fffa1b370f

[native] Download and apply logs

Description

[native] Download and apply logs

Summary:
Update the code to also apply logs. Besides the actual download_and_apply_logs function that handles downloading, decrypting and applying logs there are a few small changes that I merged with this diff. If this makes it hard to review, feel free to request changes.

  • Call triggerBackupFileUpload after C++ created a log file, so that it is uploaded
  • Change SQLiteQueryExecutor code so that it starts numbering from 1 instead of 0 (the networking client expects that it starts with 1)
  • Also store the encryption key for backup logs in UserKeys
  • restoreFromBackupLog has been updated to call resolveUnitFuture/rejectFuture after log is applied so that execution returns to the rust code

Depends on D10987

Test Plan:

  • Change StaffUtils::isStaffRelease to true
  • Enabled uploading backups
  • Made a new draft ("compaction draft")
  • Created a new compaction and waited for it to be successfuly uploaded
  • Created a new draft ("log draft")
  • Logged out
  • Logged in, into the same account
  • Checked that the drafts weren't there
  • Restored from backup
  • Restarted the app so redux would refresh
  • Checked that both drafts were restored

Reviewers: marcin, bartek, kamil

Reviewed By: marcin

Subscribers: ashoat, tomek

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

Details

Provenance
Michal Gniadek <michal.gniadek@swmansion.com>Authored on Feb 7 2024, 7:15 AM
Reviewer
marcin
Differential Revision
D11038: [native] Download and apply logs
Parents
rCOMMdb655c09ce3a: [native] Download and restore compaction
Branches
Unknown
Tags
Unknown

Event Timeline

Michal Gniadek <michal.gniadek@swmansion.com> committed rCOMM73fffa1b370f: [native] Download and apply logs (authored by Michal Gniadek <michal.gniadek@swmansion.com>).Feb 26 2024, 5:06 AM