fix: don't delete the dehydrated device before we are sure the keys got saved

This commit is contained in:
Nicolas Werner 2023-11-24 17:42:06 +01:00
parent 2fca08725d
commit 52a5485f7a
No known key found for this signature in database
GPG Key ID: B38119FF80087618
1 changed files with 6 additions and 0 deletions

View File

@ -114,6 +114,12 @@ extension DehydratedDeviceHandler on Client {
}
} while (events.events?.isNotEmpty == true);
// make sure the sessions we just received get uploaded before we upload a new device (which deletes the old device).
await this
.encryption
?.keyManager
.uploadInboundGroupSessions(skipIfInProgress: false);
await _uploadNewDevice(secureStorage);
} finally {
await encryption.dispose();