fix: wait for online key backup key to be cached on reset
Otherwise uploading the keys won't work, since the key backup is "disabled".
This commit is contained in:
parent
bbb157503d
commit
3fb77383a3
|
|
@ -581,6 +581,17 @@ class Bootstrap {
|
||||||
);
|
);
|
||||||
Logs().v('Store the secret...');
|
Logs().v('Store the secret...');
|
||||||
await newSsssKey?.store(megolmKey, base64.encode(privKey));
|
await newSsssKey?.store(megolmKey, base64.encode(privKey));
|
||||||
|
Logs().v('Wait for secret to come down sync');
|
||||||
|
|
||||||
|
if (!await encryption.keyManager.isCached()) {
|
||||||
|
await client.onSync.stream
|
||||||
|
.firstWhere((syncUpdate) =>
|
||||||
|
syncUpdate.accountData != null &&
|
||||||
|
syncUpdate.accountData!
|
||||||
|
.any((accountData) => accountData.type == megolmKey))
|
||||||
|
.then((_) => Logs().v('New backup key was created'));
|
||||||
|
}
|
||||||
|
|
||||||
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();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue