From b08c163fbe6e1757bba3917454257943851b7b5e Mon Sep 17 00:00:00 2001 From: ohassine Date: Thu, 6 Feb 2025 16:12:34 +0100 Subject: [PATCH 1/3] fix: Call stuck on Connecting state after joining a call or putting tha app in background --- .../com/wire/android/di/accountScoped/CallsModule.kt | 10 ++-------- .../wire/android/ui/calling/SharedCallingViewModel.kt | 2 +- .../android/ui/calling/SharedCallingViewModelTest.kt | 6 +++--- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/app/src/main/kotlin/com/wire/android/di/accountScoped/CallsModule.kt b/app/src/main/kotlin/com/wire/android/di/accountScoped/CallsModule.kt index 8e5e764d608..4098b7daa9d 100644 --- a/app/src/main/kotlin/com/wire/android/di/accountScoped/CallsModule.kt +++ b/app/src/main/kotlin/com/wire/android/di/accountScoped/CallsModule.kt @@ -26,7 +26,7 @@ import com.wire.kalium.logic.feature.call.usecase.EndCallOnConversationChangeUse import com.wire.kalium.logic.feature.call.usecase.EndCallUseCase import com.wire.kalium.logic.feature.call.usecase.FlipToBackCameraUseCase import com.wire.kalium.logic.feature.call.usecase.FlipToFrontCameraUseCase -import com.wire.kalium.logic.feature.call.usecase.GetAllCallsWithSortedParticipantsUseCase +import com.wire.kalium.logic.feature.call.usecase.GetIncomingCallsUseCase import com.wire.kalium.logic.feature.call.usecase.MuteCallUseCase import com.wire.kalium.logic.feature.call.usecase.ObserveEstablishedCallsUseCase import com.wire.kalium.logic.feature.call.usecase.ObserveOutgoingCallUseCase @@ -58,7 +58,7 @@ class CallsModule { @ViewModelScoped @Provides - fun provideGetIncomingCallsUseCase(callsScope: CallsScope) = + fun provideGetIncomingCallsUseCase(callsScope: CallsScope): GetIncomingCallsUseCase = callsScope.getIncomingCalls @ViewModelScoped @@ -91,12 +91,6 @@ class CallsModule { fun provideAcceptCallUseCase(callsScope: CallsScope) = callsScope.answerCall - @ViewModelScoped - @Provides - fun provideObserveCallByConversationIdUseCase( - callsScope: CallsScope - ): GetAllCallsWithSortedParticipantsUseCase = callsScope.allCallsWithSortedParticipants - @ViewModelScoped @Provides fun provideOnGoingCallUseCase( diff --git a/app/src/main/kotlin/com/wire/android/ui/calling/SharedCallingViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/calling/SharedCallingViewModel.kt index 536d175b451..afc93fb868f 100644 --- a/app/src/main/kotlin/com/wire/android/ui/calling/SharedCallingViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/calling/SharedCallingViewModel.kt @@ -125,7 +125,7 @@ class SharedCallingViewModel @AssistedInject constructor( init { viewModelScope.launch { - val allCallsSharedFlow = observeEstablishedCallWithSortedParticipants(conversationId) + val allCallsSharedFlow = observeEstablishedCallWithSortedParticipants() .flowOn(dispatchers.default()).shareIn(this, started = SharingStarted.Lazily) launch { diff --git a/app/src/test/kotlin/com/wire/android/ui/calling/SharedCallingViewModelTest.kt b/app/src/test/kotlin/com/wire/android/ui/calling/SharedCallingViewModelTest.kt index 59f69ff85b7..9635c8ef649 100644 --- a/app/src/test/kotlin/com/wire/android/ui/calling/SharedCallingViewModelTest.kt +++ b/app/src/test/kotlin/com/wire/android/ui/calling/SharedCallingViewModelTest.kt @@ -73,7 +73,7 @@ import org.junit.jupiter.api.extension.ExtendWith class SharedCallingViewModelTest { @MockK - private lateinit var establishedCall: ObserveEstablishedCallWithSortedParticipantsUseCase + private lateinit var observeEstablishedCall: ObserveEstablishedCallWithSortedParticipantsUseCase @MockK private lateinit var endCall: EndCallUseCase @@ -141,7 +141,7 @@ class SharedCallingViewModelTest { @BeforeEach fun setup() { MockKAnnotations.init(this) - coEvery { establishedCall.invoke(any()) } returns callFlow + coEvery { observeEstablishedCall.invoke() } returns callFlow coEvery { observeConversationDetails.invoke(any()) } returns emptyFlow() coEvery { observeSpeaker.invoke() } returns emptyFlow() coEvery { observeInCallReactionsUseCase(any()) } returns reactionsFlow @@ -150,7 +150,7 @@ class SharedCallingViewModelTest { sharedCallingViewModel = SharedCallingViewModel( conversationId = conversationId, conversationDetails = observeConversationDetails, - observeEstablishedCallWithSortedParticipants = establishedCall, + observeEstablishedCallWithSortedParticipants = observeEstablishedCall, endCall = endCall, muteCall = muteCall, flipToFrontCamera = flipToFrontCamera, From fcff204e26bb229518c590f422684a3adc36e6ee Mon Sep 17 00:00:00 2001 From: ohassine Date: Thu, 6 Feb 2025 16:13:15 +0100 Subject: [PATCH 2/3] chore: update kalium reference --- kalium | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kalium b/kalium index 76d22069a42..95cbca95658 160000 --- a/kalium +++ b/kalium @@ -1 +1 @@ -Subproject commit 76d22069a427fd4564783de39678e857c86d1eaf +Subproject commit 95cbca956583652c1d7461e7361d848162f8499c From f8725d899a3f1645c82944d10cb69f96cf7a05b5 Mon Sep 17 00:00:00 2001 From: ohassine Date: Thu, 6 Feb 2025 16:17:08 +0100 Subject: [PATCH 3/3] chore: kalium --- kalium | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kalium b/kalium index 95cbca95658..0df1c271fca 160000 --- a/kalium +++ b/kalium @@ -1 +1 @@ -Subproject commit 95cbca956583652c1d7461e7361d848162f8499c +Subproject commit 0df1c271fca2390817e55dd6bcf72b03e6218b03