Skip to content

fix: start foreground CallService crashes [WPB-24829][WPB-24840]#4820

Open
saleniuk wants to merge 5 commits into
developfrom
fix/call-service-crashes
Open

fix: start foreground CallService crashes [WPB-24829][WPB-24840]#4820
saleniuk wants to merge 5 commits into
developfrom
fix/call-service-crashes

Conversation

@saleniuk
Copy link
Copy Markdown
Contributor

@saleniuk saleniuk commented May 13, 2026

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


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

  • Empty conversation name on call notifications - now it’s secured and if empty then it always uses some default text.
  • Added missing title and “immediate” behavior for placeholder notification.
  • Moved starting foreground to be the very first action in onStartCommand to avoid any delays.
  • Added creating a notification channel before starting foreground to ensure the channel is already created when needed.
  • Added microphone permission check before starting foreground and a fallback when not - in that case it starts foreground with type not requiring permission (it needs to be started anyway to avoid other crashes) and then closing the call and stopping service afterwards as the call won’t work otherwise.
  • Created custom StartForegroundException with some more info to be able to better investigate crashes in the future.
  • Updated the code for ending call when user is no longer in a conversation to do it for all active accounts instead of only the first one on the list (it was a bug).
  • Fixed the logic of clearing notifications and stopping the service if there are no active users - we have two ways of syncing: pushes or persistent socket and we handle both user lists separately and the logic was checking if the given sub-list is empty to clear it for all users so in case the “push” list is empty and user only uses persistent socket, then app could close the service and clear all notifications for that user if it noticed that the other list is empty. Now, it checks if the user list is empty before splitting these two lists, so does it taking all users into account at once.
  • Added waiting for the completion of the initial clean-up of stale open calls (to be changed to closed) when the app starts, before starting observing calls in order to start the CallService, to avoid starting the service by mistake for the calls that are already stale.

Dependencies (Optional)

Needs releases with:

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Start a call, kill the app, open again. Disable microphone permissions and try to start or join a call. Starting the call should not crash.


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@github-actions
Copy link
Copy Markdown
Contributor

@saleniuk looks like you are rolling back kalium to a previous commitish.

This means that the PR's target branch (develop) is using a newer version of Kalium, and the changes in this PR will rollback Kalium to an older version.

develop This PR
f69a608d5126385b2a1284845657c0bbf11f9c65 53b0fcb4f74d61bfb51635f074236714cba44ec9

Is this intentional?

@github-actions
Copy link
Copy Markdown
Contributor

@saleniuk looks like you are rolling back kalium to a previous commitish.

This means that the PR's target branch (develop) is using a newer version of Kalium, and the changes in this PR will rollback Kalium to an older version.

develop This PR
f69a608d5126385b2a1284845657c0bbf11f9c65 00bdcd1bc44c36e9f7fe8a19058e380029f17085

Is this intentional?

@github-actions
Copy link
Copy Markdown
Contributor

@saleniuk looks like you are rolling back kalium to a previous commitish.

This means that the PR's target branch (develop) is using a newer version of Kalium, and the changes in this PR will rollback Kalium to an older version.

develop This PR
f69a608d5126385b2a1284845657c0bbf11f9c65 00bdcd1bc44c36e9f7fe8a19058e380029f17085

Is this intentional?

@github-actions
Copy link
Copy Markdown
Contributor

@saleniuk looks like you are rolling back kalium to a previous commitish.

This means that the PR's target branch (develop) is using a newer version of Kalium, and the changes in this PR will rollback Kalium to an older version.

develop This PR
f69a608d5126385b2a1284845657c0bbf11f9c65 00bdcd1bc44c36e9f7fe8a19058e380029f17085

Is this intentional?

@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

❌ Patch coverage is 53.65854% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.83%. Comparing base (0bb1fbf) to head (bd8dcc4).

Files with missing lines Patch % Lines
...in/kotlin/com/wire/android/services/CallService.kt 0.00% 23 Missing ⚠️
...re/android/notification/CallNotificationManager.kt 45.00% 9 Missing and 2 partials ⚠️
...in/com/wire/android/services/CallServiceManager.kt 84.21% 1 Missing and 2 partials ⚠️
...ndroid/notification/NotificationChannelsManager.kt 0.00% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (53.65%) 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    #4820      +/-   ##
===========================================
+ Coverage    51.11%   51.83%   +0.72%     
===========================================
  Files          610      610              
  Lines        21091    21866     +775     
  Branches      3392     3394       +2     
===========================================
+ Hits         10780    11334     +554     
- Misses        9299     9516     +217     
- Partials      1012     1016       +4     
Files with missing lines Coverage Δ
.../kotlin/com/wire/android/GlobalObserversManager.kt 90.16% <100.00%> (+1.48%) ⬆️
...re/android/notification/WireNotificationManager.kt 77.27% <100.00%> (+3.99%) ⬆️
...wire/android/notification/NotificationConstants.kt 18.18% <ø> (+9.09%) ⬆️
...ndroid/notification/NotificationChannelsManager.kt 0.97% <0.00%> (-0.02%) ⬇️
...in/com/wire/android/services/CallServiceManager.kt 92.20% <84.21%> (-2.44%) ⬇️
...re/android/notification/CallNotificationManager.kt 65.50% <45.00%> (+26.91%) ⬆️
...in/kotlin/com/wire/android/services/CallService.kt 9.85% <0.00%> (-2.43%) ⬇️

... and 210 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

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

@saleniuk saleniuk requested review from Garzas and MohamadJaara May 13, 2026 11:14
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.

1 participant