bug: Message reactions remove read receipts
Any time a message receives a reaction, the read receipts are removed for that message. It appears that the getReadStates function looks at message.updated_at, which changes when a reaction is added.
To Reproduce
- Send a message as user A
- Read the message as user B (message is marked as read by user B)
- React to the message as user B
- Notice that the message is now no longer marked as read by user B
Expected behavior
Reactions should not cause a read receipt to be removed.
This is very surprising and not the behavior that most would want. It might make sense for updates to message content provided by the sender to remove read receipts, but updates caused by metadata left by other users shouldn't. Read receipts are similar in concept to reactions (they're a type of automatic reaction), imagine if read receipts themselves caused message.updated_at to change...
Package version
- stream-chat-react: latest
- stream-chat-js: latest
Additional context
We've started tracking a second value, content_updated_at to represent an update in any update in the message data provided by the user (text, attachments, etc). This way we can show when a user edited a message without showing the latest time a reaction was left. This might be a potential approach but we haven't yet dug in to replacing getReadStates to solve the read receipts issue. Wanted to check with the team here first to see if there were other thoughts or any plan to resolve.
@kainosnoema thank you for reporting this. We were able to reproduce the bug. Currently we are looking into the implications and timeline, when this can be released. We will keep you updated here.