Skip to content

Conversation

@MohamadJaara
Copy link
Member


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

Fixed two O(n²) performance bottlenecks in UserRepository.kt:

  • getAllRecipients() - slow when separating team members from other users
  • fetchUsersIfUnknownByIds() - slow when filtering known vs unknown users

Solutions

Replaced List.contains() checks inside loops with Set-based lookups (O(1) instead of O(n)).

Needs releases with:

  • GitHub link to other pull request

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Briefly describe how this change was tested and if applicable the exact steps taken to verify that it works as expected.

Notes (Optional)

Specify here any other facts that you think are important for this issue.

Attachments (Optional)

Attachments like images, videos, etc. (drag and drop in the text box)


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.

@sonarqubecloud
Copy link

@github-actions
Copy link
Contributor

github-actions bot commented Oct 29, 2025

Test Results

0 tests   - 4 027   0 ✅  - 3 916   0s ⏱️ - 5m 26s
0 suites  -   680   0 💤  -   111 
0 files    -   680   0 ❌ ±    0 

Results for commit ca0dec8. ± Comparison against base commit 9a4dc9f.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 57.54%. Comparing base (6f6cbe6) to head (ca0dec8).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
.../com/wire/kalium/logic/data/user/UserRepository.kt 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3686      +/-   ##
===========================================
+ Coverage    57.49%   57.54%   +0.04%     
===========================================
  Files         1780     1780              
  Lines        59119    59135      +16     
  Branches      5757     5759       +2     
===========================================
+ Hits         33993    34027      +34     
+ Misses       22700    22678      -22     
- Partials      2426     2430       +4     
Files with missing lines Coverage Δ
.../com/wire/kalium/logic/data/user/UserRepository.kt 70.16% <83.33%> (+6.93%) ⬆️

... and 2 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 6f6cbe6...ca0dec8. 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.

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.

3 participants