@amitysupport I’m using ts-sdk for the chat. I want to know how many unread messages are there in the channel. In the channel response, I’m always getting 0 as the unread message but I have 20+ messages in that channel.
May I confirm which TS-SDK version you’re currently using?
@amitysupport I’m using 0.0.1-beta.38
@amitysupport I updated the pack into latest version 0.0.1-beta.39 but still facing the same issue. I’ve attached the channel response below
This feature is currently being worked on and is at least few weeks from completion. Currently the SDK sets it to 0 by default.
Although in the interim if you wish to calculate it on your end, you can do so using the following logic
channel's unreadCount = Max(0, channel.messageCount - Max(localReadToSegment, channelUser.ReadToSegment) ) channel's hasUnreadMention = Max(localReadToSegment, channelUser.ReadToSegment) < Max(localLastMentionedSegment, channelUser.lastMentionedSegment)
@cijin In which query I’ll get the data of
Might have been a mistake on my end. Please check, this post for details.
We’ve confirmed this issue in our current release, which should be fixed by the end of this month.
We’ll inform you once it’s released.
Any other issues please don’t hesitate to let us know.