feat: Upload keys on OKB reset

This does make the reset take longer on big accounts, but otherwise
users might sign out before the keys are uploaded, which makes the reset
more destructive than necessary. In the common case of not having any
keys it shouldn't make a difference.
This commit is contained in:
Nicolas Werner 2023-07-31 17:25:28 +02:00
parent eb0759caf5
commit a016709a40
No known key found for this signature in database
1 changed files with 2 additions and 0 deletions

View File

@ -584,6 +584,8 @@ class Bootstrap {
Logs().v( Logs().v(
'And finally set all megolm keys as needing to be uploaded again...'); 'And finally set all megolm keys as needing to be uploaded again...');
await client.database?.markInboundGroupSessionsAsNeedingUpload(); await client.database?.markInboundGroupSessionsAsNeedingUpload();
Logs().v('And uploading keys...');
await client.encryption?.keyManager.backgroundTasks();
} catch (e, s) { } catch (e, s) {
Logs().e('[Bootstrapping] Error setting up online key backup', e, s); Logs().e('[Bootstrapping] Error setting up online key backup', e, s);
state = BootstrapState.error; state = BootstrapState.error;