Skip to content

fix: set and observe stale open calls cleanup [WPB-24829]#4134

Merged
MohamadJaara merged 6 commits into
developfrom
fix/set-and-observe-stale-open-calls-cleanup
May 13, 2026
Merged

fix: set and observe stale open calls cleanup [WPB-24829]#4134
MohamadJaara merged 6 commits into
developfrom
fix/set-and-observe-stale-open-calls-cleanup

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?

Issues

Some actions, like starting a foreground service, are being executed for stale open calls before these calls are cleaned-up and closed.

Causes (Optional)

The clean-up is running in parallel with other actions that observe active calls so it's possible for these actions to receive outdated calls first.

Solutions

Create use case to observe the completion of this clean-up to execute other actions and start observing calls only after it's completed.

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Start/join a call, kill the app, open again - the call service shouldn't even attempt to start as the last call should be closed first when reopening the app.


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

github-actions Bot commented May 13, 2026

Test Results

0 tests   - 4 907   0 ✅  - 4 792   0s ⏱️ - 2m 54s
0 suites  -   805   0 💤  -   115 
0 files    -   805   0 ❌ ±    0 

Results for commit 00bdcd1. ± Comparison against base commit 7192839.

♻️ This comment has been updated with latest results.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 13, 2026

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 61.62%. Comparing base (7192839) to head (00bdcd1).

Files with missing lines Patch % Lines
...n/com/wire/kalium/logic/feature/call/CallsScope.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #4134   +/-   ##
==========================================
  Coverage      61.61%   61.62%           
- Complexity      4023     4024    +1     
==========================================
  Files           2059     2060    +1     
  Lines          67355    67368   +13     
  Branches        6649     6650    +1     
==========================================
+ Hits           41504    41515   +11     
- Misses         23206    23207    +1     
- Partials        2645     2646    +1     
Files with missing lines Coverage Δ
.../com/wire/kalium/logic/data/call/CallRepository.kt 89.68% <100.00%> (+0.30%) ⬆️
...all/usecase/ObserveStaleOpenCallsCleanupUseCase.kt 100.00% <100.00%> (ø)
...n/com/wire/kalium/logic/feature/call/CallsScope.kt 0.00% <0.00%> (ø)

... and 1 file 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 7192839...00bdcd1. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

🐰 Bencher Report

Branchfix/set-and-observe-stale-open-calls-cleanup
Testbedubuntu-latest

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymicroseconds (µs)
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInFiles📈 view plot
⚠️ NO THRESHOLD
908.71 µs
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInMemory📈 view plot
⚠️ NO THRESHOLD
591,159.97 µs
com.wire.kalium.benchmarks.persistence.MessageReadBenchmark.inboxPagingDeepPageBenchmark📈 view plot
⚠️ NO THRESHOLD
132,749.00 µs
com.wire.kalium.benchmarks.persistence.MessageReadBenchmark.inboxPagingFirstPageBenchmark📈 view plot
⚠️ NO THRESHOLD
126,535.84 µs
com.wire.kalium.benchmarks.persistence.MessageReadBenchmark.localMarkAsReadBenchmark📈 view plot
⚠️ NO THRESHOLD
3,433.35 µs
com.wire.kalium.benchmarks.persistence.MessageReadBenchmark.messagePagingDeepPageBenchmark📈 view plot
⚠️ NO THRESHOLD
26,203.31 µs
com.wire.kalium.benchmarks.persistence.MessageReadBenchmark.messagePagingFirstPageBenchmark📈 view plot
⚠️ NO THRESHOLD
11,235.73 µs
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.messageInsertionBenchmark📈 view plot
⚠️ NO THRESHOLD
1,341,222.90 µs
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.queryMessagesBenchmark📈 view plot
⚠️ NO THRESHOLD
21,105.05 µs
🐰 View full continuous benchmarking report in Bencher

@MohamadJaara
Copy link
Copy Markdown
Member

woudn't a nice solution to not get the ongoing state from sqlite and relay purly on AVS + in memory store for it

we can still store data about the calls and who called but just not if it is ongoing?

@sonarqubecloud
Copy link
Copy Markdown

@saleniuk saleniuk requested a review from Garzas May 13, 2026 11:14
@MohamadJaara MohamadJaara added this pull request to the merge queue May 13, 2026
Merged via the queue into develop with commit 541dc48 May 13, 2026
25 checks passed
@MohamadJaara MohamadJaara deleted the fix/set-and-observe-stale-open-calls-cleanup branch May 13, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants