[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