The alternative is to do it at the end of the getBackupUserKeys call, however, I decided to do it like it because of two reasons:
- getBackupUserKeys is a promise resolved by Rust, we'll need to implement Rust calling setUserDataKeys and scheduling on the Database thread which is more complex.
- We might want to call getBackupUserKeys just to inspect to return value without setting the key and rekeying the database, it is better to do it only when needed, directly from the restore protocol.
Depends on D14268