Skip to content

feat: Download room keys from backup before building key bundle.#6017

Merged
kaylendog merged 4 commits intomainfrom
kaylendog/history-sharing/backup-download
Jan 16, 2026
Merged

feat: Download room keys from backup before building key bundle.#6017
kaylendog merged 4 commits intomainfrom
kaylendog/history-sharing/backup-download

Conversation

@kaylendog
Copy link
Copy Markdown
Contributor

@kaylendog kaylendog commented Jan 12, 2026

  • Modifies share_room_history to fetch all room keys from backup if this has not done before.
  • Introduces a new store in IndexedDB and a new table in SQLite to track whether the above has been done b efore.
  • Public API changes documented in changelogs (optional)

Signed-off-by: Skye Elliot actuallyori@gmail.com

@kaylendog kaylendog self-assigned this Jan 12, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 12, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.93%. Comparing base (11d4305) to head (8a89726).
⚠️ Report is 16 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/matrix-sdk-sqlite/src/crypto_store.rs 78.57% 1 Missing and 2 partials ⚠️
crates/matrix-sdk-crypto/src/store/memorystore.rs 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6017      +/-   ##
==========================================
- Coverage   88.94%   88.93%   -0.01%     
==========================================
  Files         357      357              
  Lines       99178    99198      +20     
  Branches    99178    99198      +20     
==========================================
+ Hits        88210    88223      +13     
- Misses       6987     6992       +5     
- Partials     3981     3983       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jan 12, 2026

Merging this PR will not alter performance

✅ 50 untouched benchmarks


Comparing kaylendog/history-sharing/backup-download (8a89726) with main (fbff1ee)

Open in CodSpeed

@kaylendog kaylendog force-pushed the kaylendog/history-sharing/backup-download branch 2 times, most recently from 92a1733 to 1436a75 Compare January 13, 2026 15:07
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
@kaylendog kaylendog force-pushed the kaylendog/history-sharing/backup-download branch from 1436a75 to afe30c3 Compare January 13, 2026 15:19
- Splits `test_secret_gossip_after_interactive_verification ` into a helper method.

Signed-off-by: Skye Elliot <actuallyori@gmail.com>
@kaylendog kaylendog force-pushed the kaylendog/history-sharing/backup-download branch 2 times, most recently from afe30c3 to 831ab6d Compare January 13, 2026 15:47
@kaylendog kaylendog marked this pull request as ready for review January 13, 2026 15:52
@kaylendog kaylendog requested review from a team as code owners January 13, 2026 15:52
@kaylendog kaylendog requested review from andybalaam and stefanceriu and removed request for a team January 13, 2026 15:52
Copy link
Copy Markdown
Member

@andybalaam andybalaam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Couple of tiny comments.

Before we merge I'd like to see how this is rendered in clients. Presumably this download could be really slow so they will need to display a spinner or equivalent.

Comment thread crates/matrix-sdk-crypto/src/store/traits.rs
Comment thread crates/matrix-sdk-sqlite/src/crypto_store.rs Outdated
@kaylendog
Copy link
Copy Markdown
Contributor Author

Before we merge I'd like to see how this is rendered in clients. Presumably this download could be really slow so they will need to display a spinner or equivalent.

We do indeed, tested and works!

@kaylendog kaylendog enabled auto-merge January 16, 2026 16:56
@kaylendog kaylendog merged commit 90390d7 into main Jan 16, 2026
59 of 60 checks passed
@kaylendog kaylendog deleted the kaylendog/history-sharing/backup-download branch January 16, 2026 17:03
kaylendog added a commit that referenced this pull request Jan 26, 2026
…DB. (#6044)

While #6017 is mostly
functional, there are two issues:

- I did not process `changes.room_key_bundles_fully_downloaded` in
`matrix-sdk-sqlite`, meaning any updates made via `Changes` would not be
persisted;
- I used a non-encrypting `JsValue` serialisation for the same field in
`matrix-sdk-indexeddb`, which causes errors when passed to the
decryption-enabled deserializer.

Solutions:

- Process the aforementioned changes such that keys are added to SQLite;
- Use a non-encrypting deserialiser, since this is effectively a
hash-set, and the contents aren't sensitive.

Signed-off-by: Skye Elliot <actuallyori@gmail.com>
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.

2 participants