From 5bc991e24a8418e5d6999426401dfcf641f84125 Mon Sep 17 00:00:00 2001 From: Jacob Persson <7156+typfel@users.noreply.github.com> Date: Thu, 14 Sep 2023 14:06:06 +0200 Subject: [PATCH 1/7] fix: don't fail migration query if messages has already been copied --- .../commonMain/db_user/com/wire/kalium/persistence/Messages.sq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/persistence/src/commonMain/db_user/com/wire/kalium/persistence/Messages.sq b/persistence/src/commonMain/db_user/com/wire/kalium/persistence/Messages.sq index 7119f425a03..94fd6b29eb4 100644 --- a/persistence/src/commonMain/db_user/com/wire/kalium/persistence/Messages.sq +++ b/persistence/src/commonMain/db_user/com/wire/kalium/persistence/Messages.sq @@ -507,6 +507,6 @@ INSERT OR IGNORE INTO MessageRecipientFailure(message_id, conversation_id, recip VALUES(?, ?, ?, ?); moveMessages: -UPDATE Message +UPDATE OR REPLACE Message SET conversation_id = :to WHERE conversation_id = :from; From daa8ffcf75c586ec61117d524ce59e211ba2f49a Mon Sep 17 00:00:00 2001 From: Jacob Persson <7156+typfel@users.noreply.github.com> Date: Thu, 14 Sep 2023 14:08:18 +0200 Subject: [PATCH 2/7] fix: don't fail the slow sync on a non-recoverable error when resolving 1-1s --- .../conversation/mls/OneOnOneResolver.kt | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/mls/OneOnOneResolver.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/mls/OneOnOneResolver.kt index 790ebd7b088..1b153fd3a18 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/mls/OneOnOneResolver.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/mls/OneOnOneResolver.kt @@ -18,6 +18,7 @@ package com.wire.kalium.logic.feature.conversation.mls import com.wire.kalium.logic.CoreFailure +import com.wire.kalium.logic.NetworkFailure import com.wire.kalium.logic.StorageFailure import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.user.OtherUser @@ -49,7 +50,23 @@ internal class OneOnOneResolverImpl( val usersWithOneOnOne = userRepository.getUsersWithOneOnOneConversation() kaliumLogger.i("Resolving one-on-one protocol for ${usersWithOneOnOne.size} user(s)") return usersWithOneOnOne.foldToEitherWhileRight(Unit) { item, _ -> - resolveOneOnOneConversationWithUser(item).map { } + resolveOneOnOneConversationWithUser(item).flatMapLeft { + when (it) { + is CoreFailure.NoKeyPackagesAvailable, + is NetworkFailure.ServerMiscommunication, + is NetworkFailure.FederatedBackendFailure, + is CoreFailure.NoCommonProtocolFound + -> { + kaliumLogger.e("Resolving one-on-one failed $it, skipping") + Either.Right(Unit) + } + + else -> { + kaliumLogger.e("Resolving one-on-one failed $it, retrying") + Either.Left(it) + } + } + }.map { } } } @@ -65,12 +82,6 @@ internal class OneOnOneResolverImpl( SupportedProtocol.PROTEUS -> oneOnOneMigrator.migrateToProteus(user) SupportedProtocol.MLS -> oneOnOneMigrator.migrateToMLS(user) } - }.flatMapLeft { - if (it is CoreFailure.NoCommonProtocolFound) { - // TODO mark conversation as read only - Either.Right(Unit) - } - Either.Left(it) } } } From 8a16bd4dad52951c1574ba94d45891412d66ebb3 Mon Sep 17 00:00:00 2001 From: Jacob Persson <7156+typfel@users.noreply.github.com> Date: Thu, 14 Sep 2023 15:55:29 +0200 Subject: [PATCH 3/7] fix: don't fail the slow sync when etablishing 1-1 fails due to missing key packages --- .../JoinExistingMLSConversationsUseCase.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationsUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationsUseCase.kt index 686bfbc71d6..552b635891c 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationsUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationsUseCase.kt @@ -25,6 +25,7 @@ import com.wire.kalium.logic.data.conversation.ConversationRepository import com.wire.kalium.logic.featureFlags.FeatureSupport import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap +import com.wire.kalium.logic.functional.flatMapLeft import com.wire.kalium.logic.functional.foldToEitherWhileRight import com.wire.kalium.logic.functional.getOrElse import com.wire.kalium.logic.kaliumLogger @@ -57,6 +58,15 @@ internal class JoinExistingMLSConversationsUseCaseImpl( return pendingConversations.map { conversation -> joinExistingMLSConversationUseCase(conversation.id) + .flatMapLeft { + if (it is CoreFailure.NoKeyPackagesAvailable) { + kaliumLogger.w("Failed to establish mls group for ${conversation.id.toLogString()} since some participants are out of key packages, skipping.") + Either.Right(Unit) + } else { + Either.Left(it) + } + + } }.foldToEitherWhileRight(Unit) { value, _ -> value } From 00e147e4a5b7f27aab4905ffa608a469e7c58073 Mon Sep 17 00:00:00 2001 From: Jacob Persson <7156+typfel@users.noreply.github.com> Date: Thu, 14 Sep 2023 16:13:54 +0200 Subject: [PATCH 4/7] fix: re-use existing mls group if it exists --- .../wire/kalium/logic/CoreCryptoExceptionMapper.kt | 1 + .../kotlin/com/wire/kalium/logic/CoreFailure.kt | 2 ++ .../data/conversation/MLSConversationRepository.kt | 12 +++++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/CoreCryptoExceptionMapper.kt b/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/CoreCryptoExceptionMapper.kt index 2e2783af545..97cd5ceac2e 100644 --- a/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/CoreCryptoExceptionMapper.kt +++ b/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/CoreCryptoExceptionMapper.kt @@ -27,6 +27,7 @@ actual fun mapMLSException(exception: Exception): MLSFailure = is CryptoError.DuplicateMessage -> MLSFailure.DuplicateMessage is CryptoError.SelfCommitIgnored -> MLSFailure.SelfCommitIgnored is CryptoError.UnmergedPendingGroup -> MLSFailure.UnmergedPendingGroup + is CryptoError.ConversationAlreadyExists -> MLSFailure.ConversationAlreadyExists else -> MLSFailure.Generic(exception) } } else { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/CoreFailure.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/CoreFailure.kt index 06bf4f068a5..520f03f1828 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/CoreFailure.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/CoreFailure.kt @@ -176,6 +176,8 @@ interface MLSFailure : CoreFailure { object UnmergedPendingGroup : MLSFailure + object ConversationAlreadyExists : MLSFailure + object ConversationDoesNotSupportMLS : MLSFailure class Generic(internal val exception: Exception) : MLSFailure { 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 7870eda7812..fcb90793be6 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 @@ -22,6 +22,7 @@ import com.wire.kalium.cryptography.CommitBundle import com.wire.kalium.cryptography.CryptoQualifiedClientId import com.wire.kalium.cryptography.CryptoQualifiedID import com.wire.kalium.logic.CoreFailure +import com.wire.kalium.logic.MLSFailure import com.wire.kalium.logic.NetworkFailure import com.wire.kalium.logic.data.client.MLSClientProvider import com.wire.kalium.logic.data.event.Event @@ -425,6 +426,12 @@ internal class MLSConversationDataSource( idMapper.toCryptoModel(groupID), publicKeys.map { mlsPublicKeysMapper.toCrypto(it) } ) + }.flatMapLeft { + if (it is MLSFailure.ConversationAlreadyExists) { + Either.Right(Unit) + } else { + Either.Left(it) + } } }.flatMap { internalAddMemberToMLSGroup(groupID, members, retryOnStaleMessage = false).onFailure { @@ -511,9 +518,12 @@ internal class MLSConversationDataSource( kaliumLogger.w("Discarding the failed commit.") return mlsClientProvider.getMLSClient().flatMap { mlsClient -> - wrapMLSRequest { + try { mlsClient.clearPendingCommit(idMapper.toCryptoModel(groupID)) + } catch (error: Throwable) { + kaliumLogger.e("Discarding pending commit failed: $error") } + Either.Right(Unit) } } } From 18174c8e59952cbf30cef936351f0b3af9d0dd19 Mon Sep 17 00:00:00 2001 From: Jacob Persson <7156+typfel@users.noreply.github.com> Date: Thu, 14 Sep 2023 16:14:49 +0200 Subject: [PATCH 5/7] fix: establish 1-1 also with other self clients --- .../feature/conversation/JoinExistingMLSConversationUseCase.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationUseCase.kt index 8e1072791aa..671305aa2a5 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationUseCase.kt @@ -141,7 +141,7 @@ internal class JoinExistingMLSConversationUseCaseImpl( conversationRepository.getConversationMembers(conversation.id).flatMap { members -> mlsConversationRepository.establishMLSGroup( protocol.groupId, - listOf(members.first()) + members ) } } From 8117cf48d190ca6de5aa3d5e8a6373d891256fcd Mon Sep 17 00:00:00 2001 From: Jacob Persson <7156+typfel@users.noreply.github.com> Date: Thu, 14 Sep 2023 16:38:39 +0200 Subject: [PATCH 6/7] test: add missing test for establishing 1-1 --- ...OrCreateOneToOneConversationUseCaseTest.kt | 2 +- .../JoinExistingMLSConversationUseCaseTest.kt | 45 ++++++++++++++++++- ...serveConversationListDetailsUseCaseTest.kt | 6 +-- .../MLSOneOnOneConversationResolverTest.kt | 2 +- .../conversation/mls/OneOnOneMigratorTest.kt | 4 +- .../logic/framework/TestConversation.kt | 4 +- .../framework/TestConversationDetails.kt | 2 +- 7 files changed, 53 insertions(+), 12 deletions(-) diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/GetOrCreateOneToOneConversationUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/GetOrCreateOneToOneConversationUseCaseTest.kt index 5d6f5e4f789..4015859c8b3 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/GetOrCreateOneToOneConversationUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/GetOrCreateOneToOneConversationUseCaseTest.kt @@ -123,6 +123,6 @@ class GetOrCreateOneToOneConversationUseCaseTest { private companion object { val OTHER_USER = TestUser.OTHER val OTHER_USER_ID = OTHER_USER.id - val CONVERSATION = TestConversation.ONE_ON_ONE + val CONVERSATION = TestConversation.ONE_ON_ONE() } } diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationUseCaseTest.kt index f0edfb1de15..0fdb5d2cdf5 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationUseCaseTest.kt @@ -26,8 +26,11 @@ import com.wire.kalium.logic.data.conversation.ConversationRepository import com.wire.kalium.logic.data.conversation.MLSConversationRepository import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.id.GroupID +import com.wire.kalium.logic.data.user.User +import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.featureFlags.FeatureSupport import com.wire.kalium.logic.framework.TestConversation +import com.wire.kalium.logic.framework.TestUser import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.util.shouldFail import com.wire.kalium.logic.util.shouldSucceed @@ -89,7 +92,7 @@ class JoinExistingMLSConversationUseCaseTest { } @Test - fun givenGroupConversationWithZeroEpoch_whenInvokingUseCase_ThenDoNotEstablishGroup() = + fun givenGroupConversationWithZeroEpoch_whenInvokingUseCase_ThenDoNotEstablishMlsGroup() = runTest { val (arrangement, joinExistingMLSConversationsUseCase) = Arrangement() .withIsMLSSupported(true) @@ -107,7 +110,7 @@ class JoinExistingMLSConversationUseCaseTest { } @Test - fun givenSelfConversationWithZeroEpoch_whenInvokingUseCase_ThenEstablishGroup() = + fun givenSelfConversationWithZeroEpoch_whenInvokingUseCase_ThenEstablishMlsGroup() = runTest { val (arrangement, joinExistingMLSConversationsUseCase) = Arrangement() .withIsMLSSupported(true) @@ -124,6 +127,26 @@ class JoinExistingMLSConversationUseCaseTest { .wasInvoked(once) } + @Test + fun givenOneOnOneConversationWithZeroEpoch_whenInvokingUseCase_ThenEstablishMlsGroup() = + runTest { + val members = listOf(TestUser.USER_ID, TestUser.OTHER_USER_ID) + val (arrangement, joinExistingMLSConversationsUseCase) = Arrangement() + .withIsMLSSupported(true) + .withHasRegisteredMLSClient(true) + .withGetConversationsByIdSuccessful(Arrangement.MLS_UNESTABLISHED_ONE_ONE_ONE_CONVERSATION) + .withGetConversationMembersSuccessful(members) + .withEstablishMLSGroupSuccessful() + .arrange() + + joinExistingMLSConversationsUseCase(Arrangement.MLS_UNESTABLISHED_ONE_ONE_ONE_CONVERSATION.id).shouldSucceed() + + verify(arrangement.mlsConversationRepository) + .suspendFunction(arrangement.mlsConversationRepository::establishMLSGroup) + .with(eq(Arrangement.GROUP_ID_ONE_ON_ONE), eq(members)) + .wasInvoked(once) + } + @Test fun givenOutOfDateEpochFailure_whenInvokingUseCase_ThenRetryWithNewEpoch() = runTest { val (arrangement, joinExistingMLSConversationsUseCase) = Arrangement() @@ -204,6 +227,13 @@ class JoinExistingMLSConversationUseCaseTest { .then { Either.Right(Unit) } } + fun withGetConversationMembersSuccessful(members: List) = apply { + given(conversationRepository) + .suspendFunction(conversationRepository::getConversationMembers) + .whenInvokedWith(anything()) + .then { Either.Right(members) } + } + fun withEstablishMLSGroupSuccessful() = apply { given(mlsConversationRepository) .suspendFunction(mlsConversationRepository::establishMLSGroup) @@ -272,6 +302,7 @@ class JoinExistingMLSConversationUseCaseTest { val GROUP_ID1 = GroupID("group1") val GROUP_ID2 = GroupID("group2") val GROUP_ID3 = GroupID("group3") + val GROUP_ID_ONE_ON_ONE = GroupID("group-one-on-ne") val GROUP_ID_SELF = GroupID("group-self") val GROUP_ID_TEAM = GroupID("group-team") @@ -314,6 +345,16 @@ class JoinExistingMLSConversationUseCaseTest { cipherSuite = Conversation.CipherSuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519 ) ).copy(id = ConversationId("self", "domain")) + + val MLS_UNESTABLISHED_ONE_ONE_ONE_CONVERSATION = TestConversation.ONE_ON_ONE( + Conversation.ProtocolInfo.MLS( + GROUP_ID_ONE_ON_ONE, + Conversation.ProtocolInfo.MLSCapable.GroupState.PENDING_JOIN, + epoch = 0UL, + keyingMaterialLastUpdate = DateTimeUtil.currentInstant(), + cipherSuite = Conversation.CipherSuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519 + ) + ).copy(id = ConversationId("one-on-one", "domain")) } } } diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/ObserveConversationListDetailsUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/ObserveConversationListDetailsUseCaseTest.kt index 15475840414..a89c892e028 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/ObserveConversationListDetailsUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/ObserveConversationListDetailsUseCaseTest.kt @@ -127,7 +127,7 @@ class ObserveConversationListDetailsUseCaseTest { @Test fun givenSomeConversationsDetailsAreUpdated_whenObservingDetailsList_thenTheUpdateIsPropagatedThroughTheFlow() = runTest { // Given - val oneOnOneConversation = TestConversation.ONE_ON_ONE + val oneOnOneConversation = TestConversation.ONE_ON_ONE() val groupConversation = TestConversation.GROUP() val conversations = listOf(groupConversation, oneOnOneConversation) @@ -286,9 +286,9 @@ class ObserveConversationListDetailsUseCaseTest { @Test fun givenConversationDetailsFailure_whenObservingDetailsList_thenIgnoreConversationWithFailure() = runTest { // Given - val successConversation = TestConversation.ONE_ON_ONE.copy(id = ConversationId("successId", "domain")) + val successConversation = TestConversation.ONE_ON_ONE().copy(id = ConversationId("successId", "domain")) val successConversationDetails = TestConversationDetails.CONVERSATION_ONE_ONE.copy(conversation = successConversation) - val failureConversation = TestConversation.ONE_ON_ONE.copy(id = ConversationId("failedId", "domain")) + val failureConversation = TestConversation.ONE_ON_ONE().copy(id = ConversationId("failedId", "domain")) val (_, observeConversationsUseCase) = Arrangement() .withConversationsList(listOf(successConversation, failureConversation)) diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/mls/MLSOneOnOneConversationResolverTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/mls/MLSOneOnOneConversationResolverTest.kt index 638a1a587c8..4eca8bb46e2 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/mls/MLSOneOnOneConversationResolverTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/mls/MLSOneOnOneConversationResolverTest.kt @@ -152,7 +152,7 @@ class MLSOneOnOneConversationResolverTest { private companion object { private val userId = TestUser.USER_ID - private val CONVERSATION_ONE_ON_ONE_PROTEUS = TestConversation.ONE_ON_ONE.copy( + private val CONVERSATION_ONE_ON_ONE_PROTEUS = TestConversation.ONE_ON_ONE().copy( id = ConversationId("one-on-one-proteus", "test"), protocol = Conversation.ProtocolInfo.Proteus, ) diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/mls/OneOnOneMigratorTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/mls/OneOnOneMigratorTest.kt index 6d88e704b72..3585bdaeff9 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/mls/OneOnOneMigratorTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/mls/OneOnOneMigratorTest.kt @@ -93,7 +93,7 @@ class OneOnOneMigratorTest { val (arrangement, oneOneMigrator) = arrange { withGetOneOnOneConversationsWithOtherUserReturning(Either.Right(emptyList())) - withCreateGroupConversationReturning(Either.Right(TestConversation.ONE_ON_ONE)) + withCreateGroupConversationReturning(Either.Right(TestConversation.ONE_ON_ONE())) withUpdateOneOnOneConversationReturning(Either.Right(Unit)) } @@ -107,7 +107,7 @@ class OneOnOneMigratorTest { verify(arrangement.userRepository) .suspendFunction(arrangement.userRepository::updateActiveOneOnOneConversation) - .with(eq(TestUser.OTHER.id), eq(TestConversation.ONE_ON_ONE.id)) + .with(eq(TestUser.OTHER.id), eq(TestConversation.ONE_ON_ONE().id)) .wasInvoked() } diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/framework/TestConversation.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/framework/TestConversation.kt index 359aed96f4e..c749ba24f7f 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/framework/TestConversation.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/framework/TestConversation.kt @@ -57,12 +57,12 @@ object TestConversation { val ID = ConversationId(conversationValue, conversationDomain) fun id(suffix: Int = 0) = ConversationId("${conversationValue}_$suffix", conversationDomain) - val ONE_ON_ONE = Conversation( + fun ONE_ON_ONE(protocolInfo: ProtocolInfo = ProtocolInfo.Proteus) = Conversation( ID.copy(value = "1O1 ID"), "ONE_ON_ONE Name", Conversation.Type.ONE_ON_ONE, TestTeam.TEAM_ID, - ProtocolInfo.Proteus, + protocolInfo, MutedConversationStatus.AllAllowed, null, null, diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/framework/TestConversationDetails.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/framework/TestConversationDetails.kt index 8791d0b3256..02ac4d426f2 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/framework/TestConversationDetails.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/framework/TestConversationDetails.kt @@ -38,7 +38,7 @@ object TestConversationDetails { ) val CONVERSATION_ONE_ONE = ConversationDetails.OneOne( - TestConversation.ONE_ON_ONE, + TestConversation.ONE_ON_ONE(), TestUser.OTHER, LegalHoldStatus.DISABLED, UserType.EXTERNAL, From 8883ef2856cf8b777ecc415e1e66c6ed6863b128 Mon Sep 17 00:00:00 2001 From: Jacob Persson <7156+typfel@users.noreply.github.com> Date: Thu, 14 Sep 2023 16:49:39 +0200 Subject: [PATCH 7/7] chore: fix detekt --- .../logic/data/conversation/MLSConversationRepository.kt | 1 + .../conversation/JoinExistingMLSConversationsUseCase.kt | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) 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 fcb90793be6..a9b8e97ba0b 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 @@ -518,6 +518,7 @@ internal class MLSConversationDataSource( kaliumLogger.w("Discarding the failed commit.") return mlsClientProvider.getMLSClient().flatMap { mlsClient -> + @Suppress("TooGenericExceptionCaught") try { mlsClient.clearPendingCommit(idMapper.toCryptoModel(groupID)) } catch (error: Throwable) { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationsUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationsUseCase.kt index 552b635891c..b34a9a42eb7 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationsUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationsUseCase.kt @@ -60,7 +60,10 @@ internal class JoinExistingMLSConversationsUseCaseImpl( joinExistingMLSConversationUseCase(conversation.id) .flatMapLeft { if (it is CoreFailure.NoKeyPackagesAvailable) { - kaliumLogger.w("Failed to establish mls group for ${conversation.id.toLogString()} since some participants are out of key packages, skipping.") + kaliumLogger.w( + "Failed to establish mls group for ${conversation.id.toLogString()} " + + "since some participants are out of key packages, skipping." + ) Either.Right(Unit) } else { Either.Left(it)