Skip to content

fix: issue where when the status is set to away, the app does not ring and no join btn is visible [WPB-22834]#5018

Open
MohamadJaara wants to merge 5 commits into
developfrom
mo/refactor/get-calls-status-from-in-memory
Open

fix: issue where when the status is set to away, the app does not ring and no join btn is visible [WPB-22834]#5018
MohamadJaara wants to merge 5 commits into
developfrom
mo/refactor/get-calls-status-from-in-memory

Conversation

@MohamadJaara

@MohamadJaara MohamadJaara commented Jul 1, 2026

Copy link
Copy Markdown
Member

https://wearezeta.atlassian.net/browse/WPB-22834

  • Move ongoing/joinable call status out of conversation state and into an in-memory call store keyed by conversation ID.
  • Use the in-memory joinable call data for conversation list/search ordering and join-call row markers.
  • Remove public conversation call-state fields from Kalium conversation models.
  • Keep existing DB call updates for compatibility with current consumers.
  • Add a changelog fragment for the breaking API/source change.
  • Fix the issue where when the status is set to away, the app does not ring and no join btn is visible, making users thinks calls are not received.

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 --> AppUI
Loading

Why

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 -> Call lookup.

Breaking Change

Removed call-state fields from public Kalium conversation models:

  • ConversationDetails.Group.hasOngoingCall
  • ConversationDetailsWithEvents.hasOngoingCall

Consumers should derive join-call UI from call APIs / the in-memory joinable-call map instead.

@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.71429% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.33%. Comparing base (473cdda) to head (3e87592).
⚠️ Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
...tlin/com/wire/android/mapper/ConversationMapper.kt 37.50% 4 Missing and 1 partial ⚠️
...wire/android/ui/calling/CallingViewModelFactory.kt 0.00% 2 Missing ⚠️
...n/com/wire/android/ui/home/HomeViewModelFactory.kt 0.00% 2 Missing ⚠️
...ome/conversationslist/ConversationListViewModel.kt 33.33% 2 Missing ⚠️

❌ 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              
Files with missing lines Coverage Δ
...me/conversations/call/ConversationCallViewModel.kt 91.37% <100.00%> (ø)
...tions/usecase/GetConversationsFromSearchUseCase.kt 80.70% <100.00%> (+1.85%) ⬆️
...wire/android/ui/calling/CallingViewModelFactory.kt 0.00% <0.00%> (ø)
...n/com/wire/android/ui/home/HomeViewModelFactory.kt 0.00% <0.00%> (ø)
...ome/conversationslist/ConversationListViewModel.kt 30.72% <33.33%> (-0.80%) ⬇️
...tlin/com/wire/android/mapper/ConversationMapper.kt 53.07% <37.50%> (-0.10%) ⬇️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 473cdda...3e87592. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MohamadJaara MohamadJaara changed the title fix: issue where when the status is set to away, the app does not ring and no join btn is visible. fix: issue where when the status is set to away, the app does not ring and no join btn is visible [WPB-22834] Jul 1, 2026
@MohamadJaara MohamadJaara requested a review from Copilot July 1, 2026 09:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ObserveJoinableCallsUseCase in conversation list/search flows to drive join-call markers and related ordering signals.
  • Update ConversationDetailsWithEvents.toConversationItem() mapping to compute hasOnGoingCall/“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.

Comment on lines 109 to +111
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)
Comment on lines 222 to 224
fun withOngoingCalls(calls: List<Call>) = apply {
coEvery { observeOngoingCalls() } returns flowOf(calls)
coEvery { observeJoinableCalls() } returns flowOf(calls.associateBy { it.conversationId })
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants