-
Notifications
You must be signed in to change notification settings - Fork 332
feat(timeline): consider unthreaded read receipts for ReceiptThread::Main
timelines when computing timeline items states.
#5527
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
feat(timeline): consider unthreaded read receipts for ReceiptThread::Main
timelines when computing timeline items states.
#5527
Conversation
…:Main` timelines when computing timeline items states.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5527 +/- ##
==========================================
- Coverage 88.57% 88.57% -0.01%
==========================================
Files 340 340
Lines 93694 93694
Branches 93694 93694
==========================================
- Hits 82989 82988 -1
- Misses 6573 6574 +1
Partials 4132 4132 ☔ View full report in Codecov by Sentry. |
CodSpeed Performance ReportMerging #5527 will not alter performanceComparing Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job, thanks! Small proposal to change the test (or if you prefer, add a new one), and that shouldn't require any changes in the timeline's code, if I understand correctly
// Alice sends 2 messages | ||
let f = &timeline.factory; | ||
timeline.handle_live_event(f.text_msg("A").sender(*ALICE)).await; | ||
timeline.handle_live_event(f.text_msg("B").sender(*ALICE).event_id(event_b)).await; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious to propose a small change in this test, that I think wouldn't require a change in the rest of the code, in theory :)
Let's add a third event with id event_c
, that's sent by Alice in a thread.
This event should be filtered out, because the timeline is set to hide_threaded_events
.
Now, make Bob's read receipt point to event_c
.
I think the outcome should remain the same, and the read receipt on event_b
should be set to Bob's.
(This enhanced version proves that, even if the unthreaded read receipt is on an in-thread event, we can put it "at the right position" in the no-threaded-events timeline.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea! Added it in 875ec25, fits right in 👍
…eipts test case with a threaded message and read receipt.
Signed-off-by: Benjamin Bouvier <[email protected]>
This patch updates the Timeline Controller's
handle_explicit_read_receipts
method to also consider unthreaded read receipts on threaded main timelines when calculating timeline items states and adds a test for it.This picks up from #5442 and fixes #5440