Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): Do not filter out own receipts in load_read_receipts_for_event #4600

Merged
merged 4 commits into from
Feb 3, 2025

Conversation

zecakeh
Copy link
Collaborator

@zecakeh zecakeh commented Feb 1, 2025

Fixes #4517.

It turns out that the bugs found in that test were due to 2 causes:

  • First commit: TestRoomDataProvider didn't use initial_user_receipts but returned hardcoded values.
  • Second commit: Our own read receipts were ignored in TimelineStateTransaction::load_read_receipts_for_event, although we need to process all read receipts via ReadReceipts::maybe_update_read_receipt because it knows how to filter out our own read receipts were needed.

…_receipts

This is consistent with load_user_receipt and avoids suprises in test results that rely on both methods.

It also avoids to need to rely on a precise event ID.

Signed-off-by: Kévin Commaille <[email protected]>
They are already filtered out where needed in maybe_update_read_receipt.

Signed-off-by: Kévin Commaille <[email protected]>
@zecakeh zecakeh requested a review from a team as a code owner February 1, 2025 08:33
@zecakeh zecakeh requested review from stefanceriu and removed request for a team February 1, 2025 08:33
Signed-off-by: Kévin Commaille <[email protected]>
Copy link

codecov bot commented Feb 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.73%. Comparing base (57919f5) to head (8d609ad).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4600      +/-   ##
==========================================
- Coverage   85.73%   85.73%   -0.01%     
==========================================
  Files         291      291              
  Lines       33288    33287       -1     
==========================================
- Hits        28538    28537       -1     
  Misses       4750     4750              

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

Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

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

Thanks for fixing <3

.handle_back_paginated_event(
timeline
.factory
.event(carol_event_content)
Copy link
Member

Choose a reason for hiding this comment

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

can call .text_msg("I am Carol!") instead of creating the RoomMessageEventContent manually.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

.handle_back_paginated_event(
timeline
.factory
.event(bob_event_content)
Copy link
Member

Choose a reason for hiding this comment

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

ditto here

.handle_back_paginated_event(
timeline
.factory
.event(alice_event_content)
Copy link
Member

Choose a reason for hiding this comment

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

and ditto here

@zecakeh zecakeh requested a review from bnjbvr February 3, 2025 09:51
@bnjbvr bnjbvr enabled auto-merge (squash) February 3, 2025 09:53
@bnjbvr bnjbvr removed the request for review from stefanceriu February 3, 2025 09:53
@bnjbvr bnjbvr merged commit 2727d72 into matrix-org:main Feb 3, 2025
40 checks passed
@zecakeh zecakeh deleted the fix-initial-own-read-receipt branch February 5, 2025 23:50
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.

Timeline has the wrong latest read receipt sometimes
2 participants