Skip to content

feat(encryption): Add high-level API for Device Dehydration (MSC3814)#6273

Open
thmasq wants to merge 1 commit intomatrix-org:mainfrom
thmasq:feat-msc3814
Open

feat(encryption): Add high-level API for Device Dehydration (MSC3814)#6273
thmasq wants to merge 1 commit intomatrix-org:mainfrom
thmasq:feat-msc3814

Conversation

@thmasq
Copy link

@thmasq thmasq commented Mar 11, 2026

This introduces a high-level interface for Device Dehydration, which allows clients to proactively create a virtual device on the server to receive E2EE keys while the primary client is offline. Currently the only way to use this is with the raw bindings of the ruma crate.

The new functionality is exposed via client.encryption().dehydrated_devices() and provides upload and rehydrate_and_absorb methods. All new additions are gated behind the unstable-msc3814 cargo feature.

As I'm unfamiliar with wiremock, I had some AI assistance when making the integration tests. I'm currently running them like the following:

cargo test -p matrix-sdk --test integration --features unstable-msc3814,testing dehydrated_devices
  • I've documented the public API Changes in the appropriate CHANGELOG.md files.
  • This PR was made with the help of AI.

Signed-off-by: Thomas Q thomasqsa@gmail.com

@thmasq thmasq requested review from a team as code owners March 11, 2026 00:57
@thmasq thmasq requested review from poljar and removed request for a team March 11, 2026 00:57
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 11, 2026

Merging this PR will not alter performance

✅ 50 untouched benchmarks


Comparing thmasq:feat-msc3814 (b6c851b) with main (a99e79a)

Open in CodSpeed

@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.90%. Comparing base (a48f238) to head (b6c851b).
⚠️ Report is 12 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6273   +/-   ##
=======================================
  Coverage   89.90%   89.90%           
=======================================
  Files         373      374    +1     
  Lines      102570   102613   +43     
  Branches   102570   102613   +43     
=======================================
+ Hits        92219    92259   +40     
+ Misses       6790     6787    -3     
- Partials     3561     3567    +6     

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

This introduces a high-level interface for Device Dehydration, which allows
clients to proactively create a virtual device on the server to receive
E2EE keys while the primary client is offline.

The new functionality is exposed via `client.encryption().dehydrated_devices()`
and provides `upload` and `rehydrate_and_absorb` methods. All new additions
are gated behind the `unstable-msc3814` cargo feature.

Signed-off-by: Thomas Q <thomasqsa@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.

1 participant