From c01866c6446e601a3dd87378fc476d61e61dc6c4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2024 08:32:34 +0000 Subject: [PATCH] =?UTF-8?q?fix(mls-migration):=20allow=20skipping=20users?= =?UTF-8?q?=20without=20KeyPackages=20during=20MLS=20migration=20(WPB-9638?= =?UTF-8?q?)=20=F0=9F=8D=92=20=F0=9F=8D=92=20(#2860)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(mls-migration): allow skipping users without KeyPackages during MLS migration (WPB-9638) 🍒 (#2852) * fix(mls-migration): allow skipping users without KeyPackages during MLS migration (WPB-9638) (#2845) * fix(mls-migration): allow skipping users without KeyPackages during mls migration * change logs to debug level instead of warning * trigger CI --------- Co-authored-by: Mojtaba Chenani * trigger CI --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Mojtaba Chenani --- .../logic/data/conversation/MLSConversationRepository.kt | 7 ++++++- .../wire/kalium/logic/feature/mlsmigration/MLSMigrator.kt | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/MLSConversationRepository.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/MLSConversationRepository.kt index d6697b13ef6..ac47939b137 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/MLSConversationRepository.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/MLSConversationRepository.kt @@ -472,12 +472,17 @@ internal class MLSConversationDataSource( allowPartialMemberList: Boolean = false, ): Either = withContext(serialDispatcher) { commitPendingProposals(groupID).flatMap { - kaliumLogger.d("adding $userIdList to MLS group: $groupID") + kaliumLogger.d("adding ${userIdList.count()} users to MLS group") produceAndSendCommitWithRetryAndResult(groupID, retryOnStaleMessage = retryOnStaleMessage) { keyPackageRepository.claimKeyPackages(userIdList, cipherSuite).flatMap { result -> if (result.usersWithoutKeyPackagesAvailable.isNotEmpty() && !allowPartialMemberList) { + kaliumLogger.d( + "add members to MLS Group: failed " + + "${result.usersWithoutKeyPackagesAvailable.count()} user(s) missing KeyPackages" + ) Either.Left(CoreFailure.MissingKeyPackages(result.usersWithoutKeyPackagesAvailable)) } else { + kaliumLogger.d("add members to MLS Group: claiming KeyPackages succeed") Either.Right(result) } }.flatMap { result -> diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/mlsmigration/MLSMigrator.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/mlsmigration/MLSMigrator.kt index 228e7c5ec5e..d3056300495 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/mlsmigration/MLSMigrator.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/mlsmigration/MLSMigrator.kt @@ -138,7 +138,11 @@ internal class MLSMigratorImpl( when (protocolInfo) { is Conversation.ProtocolInfo.Mixed -> { conversationRepository.getConversationMembers(conversationId).flatMap { members -> - mlsConversationRepository.establishMLSGroup(protocolInfo.groupId, members) + mlsConversationRepository.establishMLSGroup( + protocolInfo.groupId, + members, + allowSkippingUsersWithoutKeyPackages = true + ) } Unit.right() }