Skip to content

fix: persist database keys durably [WPB-26997]#4281

Open
MohamadJaara wants to merge 1 commit into
mo/sqlcipher-raw-key-epicfrom
mo/sqlcipher-durable-key-storage
Open

fix: persist database keys durably [WPB-26997]#4281
MohamadJaara wants to merge 1 commit into
mo/sqlcipher-raw-key-epicfrom
mo/sqlcipher-durable-key-storage

Conversation

@MohamadJaara

@MohamadJaara MohamadJaara commented Jul 10, 2026

Copy link
Copy Markdown
Member

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

Summary

  • reuse one encrypted SharedPreferences delegate for all global settings views
  • use synchronous commits only for database passphrase writes that must be durable before database creation or rekey
  • serialize multi-step database-key state transitions within the process

Stack

  1. This PR: durable database-key storage infrastructure
  2. Raw SQLCipher V2 keys for new user databases
  3. Eager global database migration to a fresh raw V2 key

@sonarqubecloud

Copy link
Copy Markdown

@MohamadJaara MohamadJaara changed the title Persist database keys durably fix: persist database keys durably Jul 10, 2026
@MohamadJaara MohamadJaara marked this pull request as ready for review July 10, 2026 07:48
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Test Results

5 853 tests  ±0   5 710 ✅ ±0   4m 31s ⏱️ +8s
  885 suites ±0     143 💤 ±0 
  885 files   ±0       0 ❌ ±0 

Results for commit a3a70b2. ± Comparison against base commit 2a06786.

♻️ This comment has been updated with latest results.

@MohamadJaara MohamadJaara changed the title fix: persist database keys durably fix: persist database keys durably [WPB-26997] Jul 10, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.23%. Comparing base (2a06786) to head (a3a70b2).

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #4281      +/-   ##
=============================================
- Coverage      61.24%   61.23%   -0.01%     
+ Complexity      4013     4012       -1     
=============================================
  Files           2161     2161              
  Lines          69395    69395              
  Branches        6886     6886              
=============================================
- Hits           42499    42496       -3     
  Misses         24134    24134              
- Partials        2762     2765       +3     

see 3 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 2a06786...a3a70b2. 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 fix: persist database keys durably [WPB-26997] fix: persist database keys durably Jul 10, 2026
@MohamadJaara MohamadJaara changed the base branch from develop to mo/sqlcipher-raw-key-epic July 10, 2026 08:28
@MohamadJaara MohamadJaara changed the title fix: persist database keys durably fix: persist database keys durably [WPB-26997] Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branch${GITHUB_HEAD_REF}
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
913.51 µs
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInMemory📈 view plot
⚠️ NO THRESHOLD
597,281.24 µs
com.wire.kalium.benchmarks.persistence.MessageReadBenchmark.inboxPagingDeepPageBenchmark📈 view plot
⚠️ NO THRESHOLD
139,717.71 µs
com.wire.kalium.benchmarks.persistence.MessageReadBenchmark.inboxPagingFirstPageBenchmark📈 view plot
⚠️ NO THRESHOLD
131,136.29 µs
com.wire.kalium.benchmarks.persistence.MessageReadBenchmark.localMarkAsReadBenchmark📈 view plot
⚠️ NO THRESHOLD
3,641.23 µs
com.wire.kalium.benchmarks.persistence.MessageReadBenchmark.messagePagingDeepPageBenchmark📈 view plot
⚠️ NO THRESHOLD
38,214.19 µs
com.wire.kalium.benchmarks.persistence.MessageReadBenchmark.messagePagingFirstPageBenchmark📈 view plot
⚠️ NO THRESHOLD
22,756.80 µs
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.messageInsertionBenchmark📈 view plot
⚠️ NO THRESHOLD
1,270,300.49 µs
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.queryMessagesBenchmark📈 view plot
⚠️ NO THRESHOLD
21,338.46 µs
🐰 View full continuous benchmarking report in Bencher

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants