Skip to content

feat: add GetSelfTeamIdUseCase to retrieve current user's team ID from cache [WPB-25803]#4847

Merged
MohamadJaara merged 1 commit into
developfrom
mo/refactor/get-team-id-from-in-memory-cache
May 21, 2026
Merged

feat: add GetSelfTeamIdUseCase to retrieve current user's team ID from cache [WPB-25803]#4847
MohamadJaara merged 1 commit into
developfrom
mo/refactor/get-team-id-from-in-memory-cache

Conversation

@MohamadJaara
Copy link
Copy Markdown
Member

@MohamadJaara MohamadJaara commented May 20, 2026

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

Avoid fetching the full self user from DB when only the current team id is needed. The team id is already cached in memory through Kalium, so these paths can use GetSelfTeamIdUseCase directly.

What changed

  • Added/provided GetSelfTeamIdUseCase through UserScope and Hilt.
  • Switched conversation list/search and self profile team-id checks to the cached provider.
  • Updated affected unit tests.

@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

❌ Patch coverage is 62.50000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.26%. Comparing base (a61caa0) to head (cb983d0).
⚠️ Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
...ome/conversationslist/ConversationListViewModel.kt 33.33% 2 Missing ⚠️
...id/ui/userprofile/self/SelfUserProfileViewModel.kt 50.00% 0 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (62.50%) 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    #4847   +/-   ##
========================================
  Coverage    51.26%   51.26%           
========================================
  Files          611      611           
  Lines        21179    21181    +2     
  Branches      3407     3405    -2     
========================================
+ Hits         10857    10859    +2     
- Misses        9307     9308    +1     
+ Partials      1015     1014    -1     
Files with missing lines Coverage Δ
...tions/usecase/GetConversationsFromSearchUseCase.kt 81.03% <100.00%> (+2.08%) ⬆️
...id/ui/userprofile/self/SelfUserProfileViewModel.kt 58.15% <50.00%> (ø)
...ome/conversationslist/ConversationListViewModel.kt 35.07% <33.33%> (-0.19%) ⬇️

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 a61caa0...cb983d0. 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 feat: add GetSelfTeamIdUseCase to retrieve current user's team ID from cache feat: add GetSelfTeamIdUseCase to retrieve current user's team ID from cache [WPB-25803] May 21, 2026
@MohamadJaara MohamadJaara added this pull request to the merge queue May 21, 2026
Merged via the queue into develop with commit ee94683 May 21, 2026
21 of 22 checks passed
@MohamadJaara MohamadJaara deleted the mo/refactor/get-team-id-from-in-memory-cache branch May 21, 2026 07:33
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.

3 participants