diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/ScheduleNewAssetMessageUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/ScheduleNewAssetMessageUseCase.kt index 795fab0021a..650495fcbbe 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/ScheduleNewAssetMessageUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/ScheduleNewAssetMessageUseCase.kt @@ -131,8 +131,7 @@ internal class ScheduleNewAssetMessageUseCaseImpl( observeFileSharingStatus().first().also { when (it.state) { FileSharingStatus.Value.Disabled -> return ScheduleNewAssetMessageResult.Failure.DisabledByTeam - FileSharingStatus.Value.EnabledAll -> { /* no-op*/ - } + FileSharingStatus.Value.EnabledAll -> { /* no-op*/ } is FileSharingStatus.Value.EnabledSome -> if (!validateAssetMimeTypeUseCase(assetMimeType, it.state.allowedType)) { kaliumLogger.e("The asset message trying to be processed has invalid content data") diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageScope.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageScope.kt index ec0bf8cd10a..a8c4def3bc0 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageScope.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageScope.kt @@ -57,18 +57,11 @@ import com.wire.kalium.logic.feature.asset.ObserveAssetStatusesUseCase import com.wire.kalium.logic.feature.asset.ObserveAssetStatusesUseCaseImpl import com.wire.kalium.logic.feature.asset.ScheduleNewAssetMessageUseCase import com.wire.kalium.logic.feature.asset.ScheduleNewAssetMessageUseCaseImpl -<<<<<<< HEAD import com.wire.kalium.logic.feature.asset.UpdateAssetMessageTransferStatusUseCase import com.wire.kalium.logic.feature.asset.UpdateAssetMessageTransferStatusUseCaseImpl import com.wire.kalium.logic.feature.message.composite.SendButtonActionConfirmationMessageUseCase -======= -import com.wire.kalium.logic.feature.asset.UpdateAssetMessageDownloadStatusUseCase -import com.wire.kalium.logic.feature.asset.UpdateAssetMessageDownloadStatusUseCaseImpl -import com.wire.kalium.logic.feature.asset.UpdateAssetMessageUploadStatusUseCase -import com.wire.kalium.logic.feature.asset.UpdateAssetMessageUploadStatusUseCaseImpl import com.wire.kalium.logic.feature.asset.ValidateAssetMimeTypeUseCase import com.wire.kalium.logic.feature.asset.ValidateAssetMimeTypeUseCaseImpl ->>>>>>> 596eb022e3 (fix: asset restriction [WPB-9947] (#2831) (#2856) (#2861)) import com.wire.kalium.logic.feature.message.composite.SendButtonActionMessageUseCase import com.wire.kalium.logic.feature.message.composite.SendButtonMessageUseCase import com.wire.kalium.logic.feature.message.draft.GetMessageDraftUseCase diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/asset/ScheduleNewAssetMessageUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/asset/ScheduleNewAssetMessageUseCaseTest.kt index 4e68ef7e390..6b99fbfd593 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/asset/ScheduleNewAssetMessageUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/asset/ScheduleNewAssetMessageUseCaseTest.kt @@ -42,11 +42,7 @@ import com.wire.kalium.logic.data.sync.SlowSyncStatus import com.wire.kalium.logic.feature.message.MessageSendFailureHandler import com.wire.kalium.logic.feature.message.MessageSender import com.wire.kalium.logic.feature.selfDeletingMessages.ObserveSelfDeletionTimerSettingsForConversationUseCase -<<<<<<< HEAD -======= -import com.wire.kalium.logic.data.message.SelfDeletionTimer import com.wire.kalium.logic.feature.user.ObserveFileSharingStatusUseCase ->>>>>>> 596eb022e3 (fix: asset restriction [WPB-9947] (#2831) (#2856) (#2861)) import com.wire.kalium.logic.framework.TestAsset.dummyUploadedAssetId import com.wire.kalium.logic.framework.TestAsset.mockedLongAssetData import com.wire.kalium.logic.functional.Either @@ -65,6 +61,7 @@ import io.mockative.matches import io.mockative.mock import io.mockative.once import io.mockative.twice +import io.mockative.verify import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.MutableStateFlow @@ -253,11 +250,8 @@ class ScheduleNewAssetMessageUseCaseTest { .withSelfDeleteTimer(SelfDeletionTimer.Disabled) .withObserveMessageVisibility() .withDeleteAssetLocally() -<<<<<<< HEAD .withUpdateMessageAssetTransferStatus(UpdateTransferStatusResult.Success) -======= .withObserveFileSharingStatusResult(FileSharingStatus.Value.EnabledAll) ->>>>>>> 596eb022e3 (fix: asset restriction [WPB-9947] (#2831) (#2856) (#2861)) .arrange() // When @@ -275,7 +269,6 @@ class ScheduleNewAssetMessageUseCaseTest { advanceUntilIdle() // Then -<<<<<<< HEAD coVerify { arrangement.persistMessage.invoke(any()) }.wasInvoked(exactly = twice) @@ -288,23 +281,6 @@ class ScheduleNewAssetMessageUseCaseTest { coVerify { arrangement.messageSendFailureHandler.handleFailureAndUpdateMessageStatus(any(), any(), any(), any(), any()) }.wasInvoked(exactly = once) -======= - verify(arrangement.persistMessage) - .suspendFunction(arrangement.persistMessage::invoke) - .with(any()) - .wasInvoked(exactly = twice) - verify(arrangement.assetDataSource) - .suspendFunction(arrangement.assetDataSource::uploadAndPersistPrivateAsset) - .with(any(), any(), any(), any()) - .wasInvoked(exactly = once) - verify(arrangement.messageSender) - .suspendFunction(arrangement.messageSender::sendMessage) - .with(any()) - .wasInvoked(exactly = once) - verify(arrangement.messageSendFailureHandler) - .suspendFunction(arrangement.messageSendFailureHandler::handleFailureAndUpdateMessageStatus) - .with(any(), any(), any(), any(), any()) - .wasInvoked(exactly = once) } @Test @@ -339,6 +315,10 @@ class ScheduleNewAssetMessageUseCaseTest { advanceUntilIdle() // Then + verify { arrangement.assetDataSource.persistAsset(TODO(), any(), any(), any(), any()) } + .wasInvoked(exactly = twice) + + /* verify(arrangement.persistMessage) .suspendFunction(arrangement.persistMessage::invoke) .with( @@ -348,7 +328,8 @@ class ScheduleNewAssetMessageUseCaseTest { } ) .wasInvoked(exactly = twice) ->>>>>>> 596eb022e3 (fix: asset restriction [WPB-9947] (#2831) (#2856) (#2861)) + + */ } @Test @@ -411,11 +392,8 @@ class ScheduleNewAssetMessageUseCaseTest { .withSelfDeleteTimer(SelfDeletionTimer.Disabled) .withObserveMessageVisibility() .withDeleteAssetLocally() -<<<<<<< HEAD .withUpdateMessageAssetTransferStatus(UpdateTransferStatusResult.Success) -======= .withObserveFileSharingStatusResult(FileSharingStatus.Value.EnabledAll) ->>>>>>> 596eb022e3 (fix: asset restriction [WPB-9947] (#2831) (#2856) (#2861)) .arrange() // When diff --git a/testservice/src/main/kotlin/com/wire/kalium/testservice/managed/ConversationRepository.kt b/testservice/src/main/kotlin/com/wire/kalium/testservice/managed/ConversationRepository.kt index 0e41970066f..d1ee210273d 100644 --- a/testservice/src/main/kotlin/com/wire/kalium/testservice/managed/ConversationRepository.kt +++ b/testservice/src/main/kotlin/com/wire/kalium/testservice/managed/ConversationRepository.kt @@ -383,7 +383,6 @@ sealed class ConversationRepository { throw WebApplicationException("Instance ${instance.instanceId}: Could not get recent messages") } -<<<<<<< HEAD suspend fun getMessageReceipts( instance: Instance, conversationId: ConversationId, @@ -408,10 +407,7 @@ sealed class ConversationRepository { throw WebApplicationException("Instance ${instance.instanceId}: Could not get receipts from message") } - @Suppress("LongParameterList", "LongMethod", "ThrowsCount") -======= @Suppress("LongParameterList", "LongMethod", "ThrowsCount", "ComplexMethod") ->>>>>>> 596eb022e3 (fix: asset restriction [WPB-9947] (#2831) (#2856) (#2861)) suspend fun sendFile( instance: Instance, conversationId: ConversationId,