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 unread messages indicator on room list if no messages #4846

Merged

Conversation

langleyd
Copy link
Member

@langleyd langleyd commented Jan 4, 2022

If there are no messages in a room lastPreviewableEvent will be null. We should not indicate there is an unread if we don't have a lastPreviewableEvent.

Fixes #4749

@github-actions
Copy link

github-actions bot commented Jan 4, 2022

Unit Test Results

  66 files  ±0    66 suites  ±0   57s ⏱️ +7s
135 tests ±0  135 ✔️ ±0  0 💤 ±0  0 ±0 
418 runs  ±0  418 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 9f13a9d. ± Comparison against base commit 5340d16.

@@ -136,7 +136,7 @@ internal class RoomSummaryUpdater @Inject constructor(

roomSummaryEntity.hasUnreadMessages = roomSummaryEntity.notificationCount > 0 ||
// avoid this call if we are sure there are unread events
!isEventRead(realm.configuration, userId, roomId, latestPreviewableEvent?.eventId)
latestPreviewableEvent?.let { !isEventRead(realm.configuration, userId, roomId, it.eventId) } ?: false
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Nope, by default we should consider event as unread, it's safer

Copy link
Member

Choose a reason for hiding this comment

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

as discussed with @ganfra let's keep it like that.

@bmarty bmarty merged commit 39ff9da into develop Jan 4, 2022
@bmarty bmarty deleted the feature/dla/fix-unread-message-indicator-no-messages branch January 4, 2022 14:57
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.

Rooms marked as semi unread when being invited to a room (and more cases)
3 participants