Skip to content

Rotate the current room key when we see a member leave#5231

Merged
kaylendog merged 8 commits intodevelopfrom
kaylendog/msc4268/rotate-key
Mar 25, 2026
Merged

Rotate the current room key when we see a member leave#5231
kaylendog merged 8 commits intodevelopfrom
kaylendog/msc4268/rotate-key

Conversation

@kaylendog
Copy link
Copy Markdown
Contributor

@kaylendog kaylendog commented Mar 18, 2026

This PR adds logic to the RustCrypto.onRoomMembership event handler that discards (and hence rotates) the current session whenever we see an event leave membership.

Part of element-hq/element-meta#3078

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation.
  • Linter and other CI checks pass.
  • Sign-off given on the changes (see CONTRIBUTING.md).

@kaylendog kaylendog self-assigned this Mar 18, 2026
Comment thread src/rust-crypto/rust-crypto.ts
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
@kaylendog kaylendog force-pushed the kaylendog/msc4268/rotate-key branch from 89f05c9 to af43f6c Compare March 18, 2026 14:36
@kaylendog kaylendog marked this pull request as ready for review March 18, 2026 14:37
@kaylendog kaylendog requested a review from a team as a code owner March 18, 2026 14:37
@kaylendog kaylendog requested review from andybalaam and richvdh March 18, 2026 14:37
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 good to me - one question, and I would definitely like Rich to have a look too.

Comment thread src/rust-crypto/rust-crypto.ts Outdated
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.

Yep, looks great. I feel like this would be easier to test with a real homeserver. Maybe this is one for complement-crypto, or maybe we can do that somewhere within rust-sdk?

@kaylendog
Copy link
Copy Markdown
Contributor Author

kaylendog commented Mar 20, 2026

I wrote a test in the Rust SDK for its analagous PR, which you can find here

Comment thread src/rust-crypto/rust-crypto.ts
Comment thread spec/integ/crypto/history-sharing.spec.ts
Comment thread src/rust-crypto/rust-crypto.ts Outdated
Comment thread src/rust-crypto/rust-crypto.ts Outdated
@kaylendog kaylendog requested a review from richvdh March 25, 2026 11:28
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
Copy link
Copy Markdown
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

lgtm otherwise

Comment thread src/rust-crypto/rust-crypto.ts Outdated
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
Comment thread spec/integ/crypto/history-sharing.spec.ts Outdated
@kaylendog kaylendog added this pull request to the merge queue Mar 25, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Mar 25, 2026
@kaylendog kaylendog added this pull request to the merge queue Mar 25, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Mar 25, 2026
@kaylendog kaylendog added this pull request to the merge queue Mar 25, 2026
Merged via the queue into develop with commit 71152f3 Mar 25, 2026
33 checks passed
@kaylendog kaylendog deleted the kaylendog/msc4268/rotate-key branch March 25, 2026 16:58
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.

4 participants