-
Notifications
You must be signed in to change notification settings - Fork 273
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
[i231] Old messages are read by newly added member #5212
base: develop
Are you sure you want to change the base?
Conversation
if (member?.createdAt?.after(lastRead) == true) { | ||
// If the member was added after the last read, we consider it as a freshly added member. | ||
return true | ||
} | ||
// If the difference between the member's creation and the last read is less than the threshold, we consider it | ||
// as a freshly added member. |
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.
Fix N1
@@ -758,9 +758,11 @@ public class MessageListController( | |||
val groupedMessages = mutableListOf<MessageListItemState>() | |||
val membersMap = members.associateBy { it.user.id } | |||
val sortedReads = reads | |||
.filter { it.user.id != currentUser?.id && !it.belongsToFreshlyAddedMember(membersMap) } | |||
.filter { | |||
it.user.id != currentUser?.id && membersMap.contains(it.user.id) |
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.
Fix N2
sortedReads.filter { | ||
it.lastRead.after(messageCreatedAt) | ||
&& membersMap[it.user.id]?.createdAt?.before(messageCreatedAt) == true | ||
} | ||
} ?: emptyList() | ||
|
||
val isMessageRead = messageReadBy.isNotEmpty() | ||
|
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.
Fix N3
Hey @kanat what is the status of this? |
Seems like this issue could/should be resolved on backend, since it's an issue for iOS as well. |
🎯 Goal
Closes:
☑️Contributor Checklist
General
develop
branchCode & documentation
☑️Reviewer Checklist
🎉 GIF
Please provide a suitable gif that describes your work on this pull request