fix: issue where when the status is set to away, the app does not ring and no join btn is visible [WPB-22834]#5018
Conversation
…mprove query logic
|
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (60.71%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #5018 +/- ##
===========================================
- Coverage 49.33% 49.33% -0.01%
===========================================
Files 653 653
Lines 23512 23531 +19
Branches 3607 3608 +1
===========================================
+ Hits 11600 11608 +8
- Misses 10839 10850 +11
Partials 1073 1073
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the Android app’s conversation list/search and call UI to derive “ongoing/joinable call” indicators from Kalium’s in-memory joinable-calls observation, rather than relying on persisted conversation call-state fields. This aligns with the breaking Kalium model change and targets the reported issue where calls aren’t surfaced correctly (e.g., missing join UI) when the user status is set to Away.
Changes:
- Inject and consume
ObserveJoinableCallsUseCasein conversation list/search flows to drive join-call markers and related ordering signals. - Update
ConversationDetailsWithEvents.toConversationItem()mapping to computehasOnGoingCall/“new activities” from the joinable-calls map. - Adjust DI wiring and unit tests to accommodate removal of model call-state fields and the new joinable-calls source.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| app/src/test/kotlin/com/wire/android/ui/home/conversationslist/ConversationListViewModelTest.kt | Mocks ObserveJoinableCallsUseCase to support updated conversation list ViewModel dependencies. |
| app/src/test/kotlin/com/wire/android/ui/home/conversations/usecase/GetConversationsFromSearchUseCaseTest.kt | Adds coverage ensuring joinable calls produce an ongoing-call marker in search results. |
| app/src/test/kotlin/com/wire/android/ui/home/conversations/details/updateappsaccess/UpdateAppsAccessViewModelTest.kt | Removes usage of the deleted hasOngoingCall model field in test fixtures. |
| app/src/test/kotlin/com/wire/android/ui/home/conversations/details/GroupDetailsViewModelTest.kt | Removes usage of the deleted hasOngoingCall model field in test fixtures. |
| app/src/test/kotlin/com/wire/android/ui/home/conversations/composer/MessageComposerViewModelArrangement.kt | Updates mocked conversation details to no longer require hasOngoingCall. |
| app/src/test/kotlin/com/wire/android/ui/home/conversations/call/ConversationCallViewModelTest.kt | Switches call-state observation in tests from ongoing calls list to joinable calls map. |
| app/src/main/kotlin/com/wire/android/ui/home/HomeViewModelFactory.kt | Wires ObserveJoinableCallsUseCase into conversation list/search-related construction. |
| app/src/main/kotlin/com/wire/android/ui/home/conversationslist/ConversationListViewModel.kt | Combines conversation list details with joinable calls to build UI items with join-call markers. |
| app/src/main/kotlin/com/wire/android/ui/home/conversations/usecase/GetConversationsFromSearchUseCase.kt | Combines paginated search results with joinable calls to map items with call markers. |
| app/src/main/kotlin/com/wire/android/ui/home/conversations/call/ConversationCallViewModel.kt | Uses joinable calls map to derive hasOngoingCall state for the conversation call screen. |
| app/src/main/kotlin/com/wire/android/ui/calling/CallingViewModelFactory.kt | Updates factory wiring to provide ObserveJoinableCallsUseCase to ConversationCallViewModel. |
| app/src/main/kotlin/com/wire/android/mapper/ConversationMapper.kt | Adds joinable-calls map input and derives call marker/new-activity signals from it. |
| app/src/main/kotlin/com/wire/android/di/accountScoped/CallsModule.kt | Exposes ObserveJoinableCallsUseCase from CallsScope for injection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private fun listenOngoingCall() = viewModelScope.launch { | ||
| combine(observeOngoingCalls(), observeConversationDetails(conversationId)) { calls, conversationDetailsResult -> | ||
| val hasOngoingCall = calls.any { call -> call.conversationId == conversationId } | ||
| combine(observeJoinableCalls(), observeConversationDetails(conversationId)) { callsByConversationId, conversationDetailsResult -> | ||
| val hasOngoingCall = callsByConversationId.containsKey(conversationId) |
| fun withOngoingCalls(calls: List<Call>) = apply { | ||
| coEvery { observeOngoingCalls() } returns flowOf(calls) | ||
| coEvery { observeJoinableCalls() } returns flowOf(calls.associateBy { it.conversationId }) | ||
| } |


https://wearezeta.atlassian.net/browse/WPB-22834
Data Flow
flowchart LR AVS["AVS call events"] CallRepo["CallRepository"] Memory["In-memory calls map<br/>ConversationId -> Call"] DB["Call DB writes<br/>(kept for existing consumers)"] Ordering["Conversation list/search ordering"] AppUI["Android conversation UI<br/>join button / row marker"] AVS --> CallRepo CallRepo --> Memory CallRepo --> DB Memory --> Ordering Memory --> AppUIWhy
Conversation list state should not depend on persisted calling rows or session-init reset work. Keeping active AVS call state in memory avoids DB pressure during Kalium init and gives consumers faster
ConversationId -> Calllookup.Breaking Change
Removed call-state fields from public Kalium conversation models:
ConversationDetails.Group.hasOngoingCallConversationDetailsWithEvents.hasOngoingCallConsumers should derive join-call UI from call APIs / the in-memory joinable-call map instead.