From a016709a4088f913703d61afe17aac2545e648f8 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Mon, 31 Jul 2023 17:25:28 +0200 Subject: [PATCH] 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. --- lib/encryption/utils/bootstrap.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/encryption/utils/bootstrap.dart b/lib/encryption/utils/bootstrap.dart index dc728b63..184d14f1 100644 --- a/lib/encryption/utils/bootstrap.dart +++ b/lib/encryption/utils/bootstrap.dart @@ -584,6 +584,8 @@ class Bootstrap { Logs().v( 'And finally set all megolm keys as needing to be uploaded again...'); await client.database?.markInboundGroupSessionsAsNeedingUpload(); + Logs().v('And uploading keys...'); + await client.encryption?.keyManager.backgroundTasks(); } catch (e, s) { Logs().e('[Bootstrapping] Error setting up online key backup', e, s); state = BootstrapState.error;