-
Notifications
You must be signed in to change notification settings - Fork 76
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
BUG: unread_messages return incorrect in read state #1343
Comments
Hey @thaindangelhack , could please share how your channel.markRead call looks like? What params are you passing to the method? Are you using only |
@MartinCupela Thanks for the quick response. I'm using: |
Hey @thaindangelhack , the |
@MartinCupela We want to display the number of unread messages in real time as the user scrolls through the message and code will marks it as read. |
@MartinCupela From the library docs i have another way to implement my need: Hope you have a better solution can suggest me. Thanks!!! |
Hello @thaindangelhack
You state this:
If summarized the above statement: 1. call markRead 2. unread_messages === 0. That is expected behavior - marking a channel read, you get 0 unread messages. Could you please explain why do you consider it incorrect?
How it is not compatible?
I would recommend not to fixate on functionality that simulates marking individual messages unread. |
1 & 2: 3: ok 4: 5:
This is a feature we want, so I'm trying to make it as good as possible |
hey @thaindangelhack, 1&2 4: I would not recommend what you proposed. |
@MartinCupela I mean, if unread_count = 0 then last_read_message_id of that user must equal id of last message in channel (channel now has no new messages while calling API to get data) |
If the last message is deleted, then the last message id is not equal to the last message, but the previous message that is not deleted. Deleted messages are not included in the unread count. |
what do you mean deleted message? |
In read state, last_read_message_id is always true (with the actual id I marked via API channel.markRead({ message_id: messageId }))
But sometimes, unread_messages return incorrect, always = 0
Some specific cases:
I am using: "stream-chat": "8.14.4", but when I updated to "8.33.1", this bug is still
screen-recording-2024-08-23-at-160958_OByEfuhF.1.mp4
The text was updated successfully, but these errors were encountered: