Describe the bug
When you enter a channel where you are not a member, an error appears in the console: "Failed to mark channel as read". The actual exception that is masked by the exception handler is: "Cannot read properties of null (reading 'last_read_message_id')". This is triggered by event being null here.
This appeared in v13 of the react sdk, and (I think) is due to this commit. The additions here assumes you need to update the read state of the channel if the last message you read isn't the last message in the channel. This makes sense for members of a channel, but will always say "yes, update read state" for non-members (because there will be null for expression channel.state.read[userId]). And since members don't have a read state, the event mentioned above is null.
To Reproduce
Enter any channel you're not a member of.
Expected behavior
Handles non-members viewing a channel without raising an error.
Package version
"stream-chat": "^9.9.0",
"stream-chat-react": "^13.2.1",
Describe the bug
When you enter a channel where you are not a member, an error appears in the console: "Failed to mark channel as read". The actual exception that is masked by the exception handler is: "Cannot read properties of null (reading 'last_read_message_id')". This is triggered by
eventbeing null here.This appeared in v13 of the react sdk, and (I think) is due to this commit. The additions here assumes you need to update the read state of the channel if the last message you read isn't the last message in the channel. This makes sense for members of a channel, but will always say "yes, update read state" for non-members (because there will be null for expression
channel.state.read[userId]). And since members don't have a read state, theeventmentioned above is null.To Reproduce
Enter any channel you're not a member of.
Expected behavior
Handles non-members viewing a channel without raising an error.
Package version
"stream-chat": "^9.9.0",
"stream-chat-react": "^13.2.1",