stream-chat-js
stream-chat-js copied to clipboard
Guard from watching a channel while already watched
Describe the bug Watching a channel while already watched causes issues. (double replied messages when replied to a deleted message)
To Reproduce Steps to reproduce the behavior:
- Watch a channel that is already watched.
- Send a message.
- Compose a message that replies to the message (from step 1).
- Delete the message from step 1.
- retrieve channel messages.
- replied message (from step 2) will appear twice in that list.
Expected behavior No duplicate messages should appear
Additional context
I suggest a warning when calling channel.watch
when the message is already watched and to make sure we're not rewatching it.