Skip to content

refactor: create Kalium read consumers with ViewModels - #5426

Draft
MohamadJaara wants to merge 24 commits into
developfrom
refactor/metro-consumer-rebuild
Draft

MohamadJaara wants to merge 24 commits into
developfrom
refactor/metro-consumer-rebuild

Conversation

@MohamadJaara

@MohamadJaara MohamadJaara commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Creates one Kalium read consumer when the existing factory constructs a new ViewModel, preserving its ViewModelStoreOwner across retention. All 22 binding groups remain. Captured-generation session observers, one-shot notification subscription ordering, typed navigation restoration and cleanup behavior remain as in the reviewed implementation. Depends on wireapp/kalium#4576 and pins its implementation commit f73efaa.

Review order: this implementation → #5429. The 75 newly added test methods and dedicated persistence test dependency/substitution moved to the stacked test PR. This base retains the fixture/API adaptations required by pre-existing tests and the release-note static-mock cleanup. Production code and generated stability metadata are unchanged from the previously reviewed 5141bea. No generated API reference diffs are added.

Split verification: all 2,278 app unit tests passed independently in this base. The restored stacked layer also passed all 2,355 app tests; its final one-line preservation of an old event-count assertion passed all nine focused class tests. Fresh reviewers checked test conservation, dependency placement and unchanged production trees. Prior complete technical CI belongs to 5141bea; new-head CI remains separately visible. No Jira issue exists.

Size: +3,620/−3,045 total, including the existing stability metadata refresh; the test layer is separate (+2,983/−8 across 23 files). This is the approved three-read slice, with full ADR 0017 migration and performance measurements still future work. No merge or deployment is included.

@MohamadJaara
MohamadJaara marked this pull request as ready for review October 21, 2026 15:49
@MohamadJaara
MohamadJaara requested a review from a team as a code owner October 21, 2026 15:49
@MohamadJaara
MohamadJaara requested review from Garzas and yamilmedina and removed request for a team October 21, 2026 15:49
@pull-request-size

Copy link
Copy Markdown

Ups 🫰🟨

This PR is too big. Please try to break it up into smaller PRs.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

  356 files  ±0    356 suites  ±0   1m 45s ⏱️ -2s
2 949 tests ±0  2 949 ✅ ±0  0 💤 ±0  0 ❌ ±0 
2 955 runs  ±0  2 955 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 10a7b0f. ± Comparison against base commit 4dcd1e1.

This pull request removes 1 and adds 1 tests. Note that renamed tests count towards both.
com.wire.android.services.PendingMessagesForegroundSyncHandlerTest ‑ given multiple valid sessions when sending pending messages then sends sequentially for each user()
com.wire.android.services.PendingMessagesForegroundSyncHandlerTest ‑ given multiple valid sessions when sending pending messages then checks validity before sending for each user()

♻️ This comment has been updated with latest results.

@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.37500% with 123 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.75%. Comparing base (4dcd1e1) to head (10a7b0f).

Files with missing lines Patch % Lines
...otlin/com/wire/android/ui/WireActivityViewModel.kt 55.26% 9 Missing and 8 partials ⚠️
...rc/main/kotlin/com/wire/android/WireApplication.kt 0.00% 14 Missing ⚠️
...analytics/ObserveCurrentSessionAnalyticsUseCase.kt 75.86% 9 Missing and 5 partials ⚠️
...oid/notification/DriveUploadNotificationManager.kt 0.00% 12 Missing ⚠️
...d/ui/home/sync/FeatureFlagNotificationViewModel.kt 76.19% 6 Missing and 4 partials ⚠️
...in/com/wire/android/services/CallServiceManager.kt 80.00% 0 Missing and 9 partials ⚠️
...om/wire/android/session/CurrentSessionObservers.kt 69.23% 6 Missing and 2 partials ⚠️
...otlin/com/wire/android/ui/CallFeedbackViewModel.kt 84.00% 1 Missing and 7 partials ⚠️
...id/workmanager/worker/AssetUploadObserverWorker.kt 0.00% 7 Missing ⚠️
...e/android/notification/MeetingReminderScheduler.kt 86.48% 1 Missing and 4 partials ⚠️
... and 6 more

❌ Your patch check has failed because the patch coverage (74.37%) 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    #5426      +/-   ##
===========================================
+ Coverage    54.74%   54.75%   +0.01%     
===========================================
  Files          775      775              
  Lines        27240    26812     -428     
  Branches      4530     4033     -497     
===========================================
- Hits         14912    14681     -231     
+ Misses       10900    10847      -53     
+ Partials      1428     1284     -144     
Files with missing lines Coverage Δ
...droid/services/PendingMessagesForegroundService.kt 32.53% <100.00%> (-0.02%) ⬇️
...ld/dialog/requested/LegalHoldRequestedViewModel.kt 88.75% <100.00%> (+4.13%) ⬆️
...ire/android/util/lifecycle/SyncLifecycleManager.kt 95.31% <100.00%> (+0.15%) ⬆️
...ialog/deactivated/LegalHoldDeactivatedViewModel.kt 85.29% <90.00%> (+13.86%) ⬆️
.../kotlin/com/wire/android/GlobalObserversManager.kt 89.33% <94.59%> (-3.17%) ⬇️
...ire/android/feature/ObserveAppLockConfigUseCase.kt 81.25% <62.50%> (-7.22%) ⬇️
...ndroid/ui/analytics/IsAnalyticsAvailableUseCase.kt 75.00% <57.14%> (-9.62%) ⬇️
...e/android/notification/MeetingReminderScheduler.kt 82.07% <86.48%> (-0.93%) ⬇️
...re/android/notification/WireNotificationManager.kt 81.34% <88.37%> (+1.19%) ⬆️
...ire/android/services/PersistentWebSocketService.kt 0.00% <0.00%> (ø)
... and 9 more

... and 115 files with indirect coverage changes


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 4dcd1e1...10a7b0f. Read the comment docs.

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

@github-actions

Copy link
Copy Markdown
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@github-actions

Copy link
Copy Markdown
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@MohamadJaara
MohamadJaara marked this pull request as draft October 22, 2026 07:59

This branch has not been deployed

No deployments
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