Skip to content

fix(sdk): Better handling of redacted and redaction events in Latest Event#5932

Merged
stefanceriu merged 2 commits into
matrix-org:mainfrom
Hywan:fix-issue-5899
Dec 10, 2025
Merged

fix(sdk): Better handling of redacted and redaction events in Latest Event#5932
stefanceriu merged 2 commits into
matrix-org:mainfrom
Hywan:fix-issue-5899

Conversation

@Hywan
Copy link
Copy Markdown
Member

@Hywan Hywan commented Dec 5, 2025

This patch revisits the way redacted and redaction events are handled in the Latest Event.

Previously, all redacted events were considered suitable candidate. It's no longer the case.

Redaction and redacted events are no longer considered suitable.

This patch also revisits rfind_map_event_in_memory_by to return a &TimelineEvent instead of an OwnedEventId, which could be more performant in the future.

The tests have been updated accordingly.


@Hywan Hywan requested a review from a team as a code owner December 5, 2025 14:15
@Hywan Hywan requested review from stefanceriu and removed request for a team December 5, 2025 14:15
@Hywan Hywan marked this pull request as draft December 5, 2025 14:15
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 5, 2025

Codecov Report

❌ Patch coverage is 95.34884% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.49%. Comparing base (76cae09) to head (79e394c).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/matrix-sdk/src/event_cache/room/mod.rs 88.88% 0 Missing and 1 partial ⚠️
...rates/matrix-sdk/src/latest_events/latest_event.rs 97.05% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5932      +/-   ##
==========================================
- Coverage   88.50%   88.49%   -0.01%     
==========================================
  Files         362      362              
  Lines      103438   103423      -15     
  Branches   103438   103423      -15     
==========================================
- Hits        91549    91529      -20     
- Misses       7539     7544       +5     
  Partials     4350     4350              

☔ 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 5, 2025

CodSpeed Performance Report

Merging #5932 will not alter performance

Comparing Hywan:fix-issue-5899 (79e394c) with main (76cae09)

Summary

✅ 50 untouched

@Hywan Hywan force-pushed the fix-issue-5899 branch 2 times, most recently from 36c5c25 to 76a4724 Compare December 9, 2025 10:09
…Event.

This patch revisits the way redacted and redaction events are handled in
the Latest Event.

Previously, all redacted events were considered suitable candidate. It's
no longer the case.

Redaction and redacted events are no longer considered suitable.

This patch also revisits `rfind_map_event_in_memory_by` to return a
`&TimelineEvent` instead of an `OwnedEventId`, which could be more
performant in the future.

The tests have been updated accordingly.
@Hywan Hywan marked this pull request as ready for review December 9, 2025 10:18
Copy link
Copy Markdown
Member

@stefanceriu stefanceriu left a comment

Choose a reason for hiding this comment

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

lgtm 👍

Signed-off-by: Stefan Ceriu <stefanc@matrix.org>
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.

Adding a reaction and removing it bumps a room to the top of the room list and clears its last message.

2 participants