From 3fb77383a380ab04c4e99b449eeefc0d2c6ddbd5 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Mon, 18 Sep 2023 16:28:09 +0200 Subject: [PATCH 1/3] 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". --- lib/encryption/utils/bootstrap.dart | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/encryption/utils/bootstrap.dart b/lib/encryption/utils/bootstrap.dart index 184d14f1..d17d3081 100644 --- a/lib/encryption/utils/bootstrap.dart +++ b/lib/encryption/utils/bootstrap.dart @@ -581,6 +581,17 @@ 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)) + .then((_) => Logs().v('New backup key was created')); + } + Logs().v( 'And finally set all megolm keys as needing to be uploaded again...'); await client.database?.markInboundGroupSessionsAsNeedingUpload(); From c0c95b1d64c910e9a392f959b9ab42c9baac70e1 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Mon, 18 Sep 2023 17:19:05 +0200 Subject: [PATCH 2/3] ci: don't fail fast on dendrite failure --- .github/workflows/app.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/app.yml b/.github/workflows/app.yml index 6cb18ccf..95e7d19f 100644 --- a/.github/workflows/app.yml +++ b/.github/workflows/app.yml @@ -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: From bf51e57e78bfb3edcd580605354c062cd49363cb Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Tue, 19 Sep 2023 12:24:06 +0200 Subject: [PATCH 3/3] chore: remove redundant log message --- lib/encryption/utils/bootstrap.dart | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/encryption/utils/bootstrap.dart b/lib/encryption/utils/bootstrap.dart index d17d3081..41a99808 100644 --- a/lib/encryption/utils/bootstrap.dart +++ b/lib/encryption/utils/bootstrap.dart @@ -584,12 +584,10 @@ class Bootstrap { 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')); + await client.onSync.stream.firstWhere((syncUpdate) => + syncUpdate.accountData != null && + syncUpdate.accountData! + .any((accountData) => accountData.type == megolmKey)); } Logs().v(