-
Notifications
You must be signed in to change notification settings - Fork 233
Fix sending read receipts when entering a room #1016
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
Conversation
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
I'm not too happy with this solution, but I can't really think of anything better right now. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #1016 +/- ##
===========================================
- Coverage 56.91% 56.91% -0.01%
===========================================
Files 993 993
Lines 25265 25268 +3
Branches 5115 5114 -1
===========================================
+ Hits 14380 14381 +1
- Misses 8615 8617 +2
Partials 2270 2270
☔ View full report in Codecov by Sentry. |
The implementation at ad4bc79, while simpler, makes it impossible to unit test the presenter properly, so I'll have to revert it... |
@ganfra In the end I've done a simpler implementation than the initial one, but keeping the same logic. Moving sending the read receipt for the initial items to the presenter made sense, but it made most of the logic associated with |
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.
One remark, otherwise makes sense.
But I also encounter another issue, maybe it should handled by the sdk, but if the latest events are hidden (like reactions or edit events), the has unread won't be updated properly neither.
@@ -91,6 +91,16 @@ class TimelinePresenter @Inject constructor( | |||
} | |||
|
|||
LaunchedEffect(timelineItems.size) { | |||
// We just loaded the initial items, we should send a read receipt |
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.
Remove the code?
Kudos, SonarCloud Quality Gate passed! |
The callback in
TimelineScrollHelper
was only called when the timeline items were empty, so no initial read receipt was sent anymore.Instead, we're sending a read receipt when the initial items for the timeline are loaded.