Skip to content

Commit 9da4dba

Browse files
fix: read receipts should not be removed due to message update (#1808)
**Case:** - User A sends a message on channel - User B reads the channel, and we show the read indicator to User A on that message - Now User A updates the message (or adds a reaction), so updated_at field for message is greater than read timestamp for User B **Current Implementation on React and RN** In above case, after step 3, we remove the read receipt, since message was updated after User B read the channel **Proposed Change** I think we should keep the read receipt in this case. Read receipt should only be computed based on created_at timestamp of message compared with read timestamp
1 parent 1179a94 commit 9da4dba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

package/src/components/MessageList/utils/getReadStates.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const getReadStates = <
6666
* to the array of last reads for that message and remove
6767
* the user from the list of users being checked
6868
*/
69-
if (message.updated_at < member.last_read) {
69+
if (message.created_at < member.last_read) {
7070
/**
7171
* if this is a direct message the length will be 1
7272
* as we already deleted the current user from the object

0 commit comments

Comments
 (0)