Skip to content

refactor: replace usersharedprefs [WPB-23210]#3839

Open
MohamadJaara wants to merge 4 commits intodevelopfrom
epic/replace-usersharedprefs
Open

refactor: replace usersharedprefs [WPB-23210]#3839
MohamadJaara wants to merge 4 commits intodevelopfrom
epic/replace-usersharedprefs

Conversation

@MohamadJaara
Copy link
Member

@MohamadJaara MohamadJaara commented Feb 4, 2026

TaskWPB-23210 [Android] Replace user encrypted shared preferences with metadata on db


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

app startup time can suffer from having 2 shared pref files created at startup, and the user scoped one is not really needed and its data can be moved to the user DB improving startup time

PRs added

#3830
#3833
#3835

Solutions

remove the user scoped shared preferance and replace it with the UserPrefDAO that uses the database

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.

yamilmedina and others added 4 commits February 2, 2026 17:48
… - pt1 (WPB-23210) (#3830)

* refactor: implement userprefs dao as replacements of user configs impl.

* add test

* add test
…w sync migration mechanism - pt2 (WPB-23210) (#3833)

* refactor: implement userprefs dao as replacements of user configs impl.

* add test

* add test

* refactor: change to enums for a way to wrap all the configs

* refactor: execute migration of local props and increase slow sync to have updated

* fix detekt

* fix detekt
* refactor: implement userprefs dao as replacements of user configs impl.

* add test

* add test

* refactor: change to enums for a way to wrap all the configs

* refactor: execute migration of local props and increase slow sync to have updated

* fix detekt

* refactor: remove UserPrefBuilder and create UserConfigStorage only during migration

---------

Co-authored-by: yamilmedina <yamilmedina@users.noreply.github.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 4, 2026

@MohamadJaara MohamadJaara changed the title Epic/replace usersharedprefs Epic/replace usersharedprefs [(WPB-23210)] Feb 4, 2026
@MohamadJaara MohamadJaara changed the title Epic/replace usersharedprefs [(WPB-23210)] Epic/replace usersharedprefs [WPB-23210] Feb 4, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Test Results

0 tests   - 4 300   0 ✅  - 4 185   0s ⏱️ - 4m 43s
0 suites  -   723   0 💤  -   115 
0 files    -   723   0 ❌ ±    0 

Results for commit cc3a15c. ± Comparison against base commit 06393f2.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

🐰 Bencher Report

Branchepic/replace-usersharedprefs
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
695.17 µs
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInMemory📈 view plot
⚠️ NO THRESHOLD
589,713.06 µs
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.messageInsertionBenchmark📈 view plot
⚠️ NO THRESHOLD
1,341,726.99 µs
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.queryMessagesBenchmark📈 view plot
⚠️ NO THRESHOLD
20,885.61 µs
🐰 View full continuous benchmarking report in Bencher

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 55.95855% with 85 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.57%. Comparing base (ae71a9a) to head (cc3a15c).
⚠️ Report is 5 commits behind head on develop.

Files with missing lines Patch % Lines
...in/com/wire/kalium/persistence/dao/UserPrefsDAO.kt 48.83% 40 Missing and 4 partials ⚠️
...nc/slow/migration/steps/SyncMigrationStep_10_11.kt 20.00% 20 Missing ⚠️
...ire/kalium/persistence/config/UserConfigStorage.kt 72.88% 12 Missing and 4 partials ⚠️
...kalium/logic/configuration/UserConfigRepository.kt 25.00% 3 Missing ⚠️
...in/com/wire/kalium/logic/di/UserStorageProvider.kt 0.00% 1 Missing ⚠️
...logic/sync/receiver/UserPropertiesEventReceiver.kt 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3839      +/-   ##
===========================================
+ Coverage    59.55%   59.57%   +0.02%     
===========================================
  Files         1898     1899       +1     
  Lines        59197    59417     +220     
  Branches      6417     6451      +34     
===========================================
+ Hits         35255    35398     +143     
- Misses       21027    21094      +67     
- Partials      2915     2925      +10     
Files with missing lines Coverage Δ
...n/com/wire/kalium/persistence/dao/UserConfigDAO.kt 17.24% <ø> (ø)
...lium/persistence/dao/unread/UnreadContentMapper.kt 75.00% <ø> (ø)
.../wire/kalium/persistence/db/UserDatabaseBuilder.kt 74.30% <100.00%> (+0.29%) ⬆️
...monMain/kotlin/com/wire/kalium/cells/CellsScope.kt 0.00% <ø> (ø)
...com/wire/kalium/cells/data/CellConfigDataSource.kt 0.00% <ø> (ø)
.../com/wire/kalium/logic/data/e2ei/E2EIRepository.kt 80.00% <100.00%> (+0.09%) ⬆️
.../com/wire/kalium/logic/data/team/TeamRepository.kt 98.18% <ø> (ø)
.../applock/MarkTeamAppLockStatusAsNotifiedUseCase.kt 100.00% <ø> (ø)
.../kalium/logic/feature/auth/ClearUserDataUseCase.kt 0.00% <ø> (ø)
...ature/call/usecase/IsEligibleToStartCallUseCase.kt 68.00% <100.00%> (-4.00%) ⬇️
... and 19 more

... and 22 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 ae71a9a...cc3a15c. 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.

@MohamadJaara MohamadJaara changed the title Epic/replace usersharedprefs [WPB-23210] refactor: replace usersharedprefs [WPB-23210] Feb 4, 2026
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