Skip to content

Conversation

@pixlwave
Copy link
Member

@pixlwave pixlwave commented Nov 26, 2025

This is an mvp attempt at #3065 to fix element-hq/element-x-ios#2338.

The PR adds a new TimelineReadReceiptTracking enum which is used in place of the track_read_receipts boolean to decide whether to enable tracking for all events, just for message-like events or to disable tracking.

When tracking is configured for message-like only, any read receipts on state events are bundled up into the previous event, using the same logic that receipts from filtered events are handled with.

  • Public API changes documented in changelogs (optional)
Before After
Screenshot 2025-11-26 at 9 53 19 am Simulator Screenshot - iPhone 17 - 2025-11-26 at 09 53 22

@pixlwave pixlwave force-pushed the doug/read-receipt-filters branch from 3470137 to 2ce1262 Compare November 26, 2025 10:36
@codecov
Copy link

codecov bot commented Nov 26, 2025

Codecov Report

❌ Patch coverage is 99.06542% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.66%. Comparing base (bbc6df7) to head (d0eb5d6).
⚠️ Report is 9 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ix-sdk-ui/src/timeline/controller/read_receipts.rs 94.11% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5900      +/-   ##
==========================================
- Coverage   88.66%   88.66%   -0.01%     
==========================================
  Files         363      363              
  Lines      104580   104628      +48     
  Branches   104580   104628      +48     
==========================================
+ Hits        92730    92771      +41     
- Misses       7501     7508       +7     
  Partials     4349     4349              

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

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 26, 2025

CodSpeed Performance Report

Merging #5900 will not alter performance

Comparing doug/read-receipt-filters (d0eb5d6) with main (bbc6df7)

Summary

✅ 50 untouched

@pixlwave pixlwave force-pushed the doug/read-receipt-filters branch 6 times, most recently from fb8002e to 2266d0d Compare November 26, 2025 16:54
@pixlwave pixlwave changed the title Read Receipts: Allow Timelines to be configured for renderer that can't show read receipts on state events. Read Receipts: Allow Timelines to be configured to hide read receipts on state events. Nov 26, 2025
@pixlwave pixlwave force-pushed the doug/read-receipt-filters branch 2 times, most recently from bd3b58b to 4b903d0 Compare November 27, 2025 23:28
@pixlwave pixlwave marked this pull request as ready for review November 27, 2025 23:28
@pixlwave pixlwave requested a review from a team as a code owner November 27, 2025 23:28
@pixlwave pixlwave requested review from Hywan and removed request for a team November 27, 2025 23:28
Copy link
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

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

Clean code, nice feature, great test, good documentation, what can I ask more? A tiny feedback to remove a PartialEq implementation, but otherwise it's really great, kudos 👏 and thanks for the great contribution!

AnySyncTimelineEvent::State(_) => settings.state_events_can_show_read_receipts,
AnySyncTimelineEvent::MessageLike(_) => true,
AnySyncTimelineEvent::State(_) => {
settings.track_read_receipts == TimelineReadReceiptTracking::AllEvents
Copy link
Member

Choose a reason for hiding this comment

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

It's probably better to use matches!(settings.track_read_receipts, TimelineReadReceiptTracking::AllEvents) here, so that you can remove the PartialEq implementation on this enum. Less code.

Copy link
Member Author

Choose a reason for hiding this comment

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

@pixlwave pixlwave force-pushed the doug/read-receipt-filters branch from 4b903d0 to fdc7479 Compare December 2, 2025 10:25
@pixlwave pixlwave force-pushed the doug/read-receipt-filters branch from fdc7479 to d0eb5d6 Compare December 2, 2025 10:27
@pixlwave
Copy link
Member Author

pixlwave commented Dec 2, 2025

Force pushed to fix a conflict on the changelog.

@pixlwave pixlwave requested a review from Hywan December 2, 2025 10:28
@Hywan Hywan merged commit 0176448 into main Dec 2, 2025
53 checks passed
@Hywan Hywan deleted the doug/read-receipt-filters branch December 2, 2025 14:36
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.

RRs are missing when a state event is the latest displayed event, causing them to disappear

3 participants