Merge pull request #1562 from famedly/nico/fix-okb-bootstrap

fix: wait for online key backup key to be cached on reset
This commit is contained in:
Nicolas Werner 2023-09-19 14:28:07 +02:00 committed by GitHub
commit 02d7569c90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -18,6 +18,8 @@ jobs:
strategy:
matrix:
homeserver: [synapse, dendrite, conduit]
# since the dendrite job is optional, actually run all tests to the end instead of failing on first error.
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Run tests
@ -36,8 +38,8 @@ jobs:
scripts/prepare.sh
scripts/test_driver.sh"
# coverage is done on the flutter-linux image because we setup olm there
# coverage_without_olm is done on dart images because why not :D
# coverage is done on the flutter-linux image because we setup olm there
# coverage_without_olm is done on dart images because why not :D
coverage:
runs-on: ubuntu-latest
container:

View File

@ -581,6 +581,15 @@ class Bootstrap {
);
Logs().v('Store the secret...');
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));
}
Logs().v(
'And finally set all megolm keys as needing to be uploaded again...');
await client.database?.markInboundGroupSessionsAsNeedingUpload();