Skip to content

timeline: when deduplicating event meta, keep the most recent instead of the oldest #3570

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

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Jun 18, 2024

Not doing this leads to an invalid ordering of events, as shown in the test: if we increase the timeline limit of a room using sliding sync, we'll receive a duplicate event, and if we ignore it, it'll be in an invalid position. The solution is to keep the most recent event (and remove the old one from event_meta).

Fixes a regression from #3550.

… of the oldest

Not doing this leads to an invalid ordering of events, as shown in the
test: if we increase the timeline limit of a room using sliding sync,
we'll receive a duplicate event, and if we ignore it, it'll be in an
invalid position. The solution is to keep the most recent event (and
remove the old one from event_meta).
@bnjbvr bnjbvr requested a review from andybalaam June 18, 2024 10:48
@bnjbvr bnjbvr requested a review from a team as a code owner June 18, 2024 10:48
Copy link

codecov bot commented Jun 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.86%. Comparing base (304350f) to head (5134124).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3570      +/-   ##
==========================================
+ Coverage   83.82%   83.86%   +0.03%     
==========================================
  Files         253      253              
  Lines       25915    25915              
==========================================
+ Hits        21723    21733      +10     
+ Misses       4192     4182      -10     

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

Copy link
Member

@andybalaam andybalaam left a comment

Choose a reason for hiding this comment

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

Does what it says it does, and sounds like it is needed to fix this problem, but (I think?) exposes the fact that we need some kind of wider understanding of the order of an event, independent of how we received it. I thought the timeline included some of that, but maybe I'm wrong.

@bnjbvr bnjbvr merged commit 0b9daa2 into main Jun 18, 2024
38 checks passed
@bnjbvr bnjbvr deleted the bnjbvr/delete-oldest-event branch June 18, 2024 12:39
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