Skip to content

Conversation

@Hywan
Copy link
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.

Only redaction event (m.room.redaction) are considered suitable candidate if and only if it targets the immediate previous event, and if and only if the previous event is itself a suitable candidate.

To achieve so, the rfind_map_event_in_memory_by method is revisited to return the &TimelineEvent instead of the OwnedEventId.

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
…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.

Only redaction event (`m.room.redaction`) are considered suitable
candidate if and only if it targets the immediate previous event, and if
and only if the previous event is itself a suitable candidate.

To achieve so, the `rfind_map_event_in_memory_by` method is revisited to
return the `&TimelineEvent` instead of the `OwnedEventId`.

The tests have been updated accordingly.
@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

❌ Patch coverage is 98.96907% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.51%. Comparing base (238e4e8) to head (61bc261).
✅ 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 ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5932      +/-   ##
==========================================
+ Coverage   88.50%   88.51%   +0.01%     
==========================================
  Files         362      362              
  Lines      103291   103339      +48     
  Branches   103291   103339      +48     
==========================================
+ Hits        91413    91469      +56     
+ Misses       7535     7528       -7     
+ Partials     4343     4342       -1     

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

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 5, 2025

CodSpeed Performance Report

Merging #5932 will not alter performance

Comparing Hywan:fix-issue-5899 (61bc261) with main (238e4e8)

Summary

✅ 50 untouched

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.

1 participant