Skip to content

fix(event_cache): store correct encryption information for local echoes#5936

Merged
poljar merged 7 commits into
mainfrom
stefan/localEchoEncryptionInfo
Dec 9, 2025
Merged

fix(event_cache): store correct encryption information for local echoes#5936
poljar merged 7 commits into
mainfrom
stefan/localEchoEncryptionInfo

Conversation

@stefanceriu
Copy link
Copy Markdown
Member

This patch exposes one's underlying EncryptionInfo used when sending raw Room events, uses it to create a DecryptedRoomEvent and corresponding TimelineEvent, and correctly populates the EventCache with local echoes.

@stefanceriu stefanceriu requested a review from poljar December 8, 2025 16:00
Copy link
Copy Markdown
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

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

We can tweak this a bit more to make it more correct, also a regression test for this would be very welcome.

Comment thread crates/matrix-sdk/src/room/futures.rs Outdated
Comment thread crates/matrix-sdk-crypto/src/machine/mod.rs Outdated
Comment thread crates/matrix-sdk/src/room/futures.rs Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 8, 2025

Codecov Report

❌ Patch coverage is 90.52632% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.50%. Comparing base (29b693e) to head (7b0d49c).
⚠️ Report is 11 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/matrix-sdk-crypto/src/machine/mod.rs 88.57% 4 Missing ⚠️
...ates/matrix-sdk/src/encryption/identities/users.rs 50.00% 0 Missing and 1 partial ⚠️
crates/matrix-sdk/src/room/futures.rs 83.33% 0 Missing and 1 partial ⚠️
crates/matrix-sdk/src/room/mod.rs 0.00% 0 Missing and 1 partial ⚠️
crates/matrix-sdk/src/send_queue/mod.rs 95.45% 0 Missing and 1 partial ⚠️
crates/matrix-sdk/src/widget/matrix.rs 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5936      +/-   ##
==========================================
- Coverage   88.50%   88.50%   -0.01%     
==========================================
  Files         362      362              
  Lines      103351   103399      +48     
  Branches   103351   103399      +48     
==========================================
+ Hits        91469    91511      +42     
- Misses       7534     7540       +6     
  Partials     4348     4348              

☔ 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 Dec 8, 2025

CodSpeed Performance Report

Merging #5936 will not alter performance

Comparing stefan/localEchoEncryptionInfo (7b0d49c) with main (b98a832)

Summary

✅ 50 untouched

@stefanceriu stefanceriu force-pushed the stefan/localEchoEncryptionInfo branch 4 times, most recently from 3e173fb to 56d370b Compare December 9, 2025 08:59
…ng `MessageLike` and `RawMessageLike` events
…` to create a `DecryptedRoomEvent` and corresponding `TimelineEvent` and correctly populate the Event Cache.
@stefanceriu stefanceriu force-pushed the stefan/localEchoEncryptionInfo branch from 56d370b to 34f8f1c Compare December 9, 2025 09:41
@stefanceriu stefanceriu marked this pull request as ready for review December 9, 2025 09:46
@stefanceriu stefanceriu requested review from a team as code owners December 9, 2025 09:46
@stefanceriu stefanceriu requested review from poljar and removed request for a team December 9, 2025 09:46
@stefanceriu
Copy link
Copy Markdown
Member Author

Okay, I went ahead and rewrote most of this based on the last idea.

Copy link
Copy Markdown
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

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

Alright, this looks good. Very nicely done.

Can we just get appropriate changelog entries for the main crate and the crypto crate.

Furthermore, a regression test for this would be very nice.

Copy link
Copy Markdown
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

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

Took a bit of time to figure out why things weren't working, but we got there.

@poljar poljar enabled auto-merge (rebase) December 9, 2025 17:35
@poljar poljar merged commit 604ce4a into main Dec 9, 2025
52 checks passed
@poljar poljar deleted the stefan/localEchoEncryptionInfo branch December 9, 2025 17:49
andybalaam added a commit to matrix-org/matrix-sdk-crypto-wasm that referenced this pull request Dec 10, 2025
and adapt encrypt_room_event to preserve its interface despite the
change introduced in
matrix-org/matrix-rust-sdk#5936 .
andybalaam added a commit to matrix-org/matrix-sdk-crypto-wasm that referenced this pull request Dec 10, 2025
and adapt encrypt_room_event to preserve its interface despite the
change introduced in
matrix-org/matrix-rust-sdk#5936 .
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