# Defaultchannelunread count always 0

**URL:** <https://forum.social.plus/t/defaultchannelunread-count-always-0/663>\
**Category:** Web\
**Created:** [March 6, 2023, 12:25pm UTC](https://forum.social.plus/t/defaultchannelunread-count-always-0/663 "2023-03-06T12:25:53Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarathdixit](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@sarathdixit](https://forum.social.plus/u/sarathdixit)\
**Post date:** [March 6, 2023, 12:25pm UTC](https://forum.social.plus/t/defaultchannelunread-count-always-0/663/1 "2023-03-06T12:25:53Z")

</div>

@SocialPlus_Support 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.

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [March 7, 2023, 3:57am UTC](https://forum.social.plus/t/defaultchannelunread-count-always-0/663/2 "2023-03-07T03:57:50Z")

</div>

Hi @sarathdixit

May I confirm which TS-SDK version you’re currently using?

Thank you,  
Amity Support

---

<div class="post-metadata">

**Author:** ![sarathdixit](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@sarathdixit](https://forum.social.plus/u/sarathdixit)\
**Post date:** [March 7, 2023, 5:34am UTC](https://forum.social.plus/t/defaultchannelunread-count-always-0/663/3 "2023-03-07T05:34:46Z")

</div>

@SocialPlus_Support I’m using 0.0.1-beta.38

---

<div class="post-metadata">

**Author:** ![sarathdixit](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@sarathdixit](https://forum.social.plus/u/sarathdixit)\
**Post date:** [March 7, 2023, 5:47am UTC](https://forum.social.plus/t/defaultchannelunread-count-always-0/663/4 "2023-03-07T05:47:50Z")

</div>

@SocialPlus_Support 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

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/amity/original/1X/a622c28230bdbf598360261ca4c0059e0c75d1ac.png)

---

<div class="post-metadata">

**Author:** ![cijin](https://avatars.discourse-cdn.com/v4/letter/c/49beb7/32.png) [@cijin](https://forum.social.plus/u/cijin)\
**Post date:** [March 7, 2023, 9:09am UTC](https://forum.social.plus/t/defaultchannelunread-count-always-0/663/5 "2023-03-07T09:09:14Z")

</div>

Hey @sarathdixit,

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

```auto
channel's unreadCount = Max(0, channel.messageCount - Max(localReadToSegment, channelUser.ReadToSegment) )

channel's hasUnreadMention = Max(localReadToSegment, channelUser.ReadToSegment) 
                          < Max(localLastMentionedSegment, channelUser.lastMentionedSegment)

```

C.C @SocialPlus_Support

---

<div class="post-metadata">

**Author:** ![sarathdixit](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@sarathdixit](https://forum.social.plus/u/sarathdixit)\
**Post date:** [March 9, 2023, 4:39am UTC](https://forum.social.plus/t/defaultchannelunread-count-always-0/663/6 "2023-03-09T04:39:01Z")

</div>

> [@cijin](#):
>
> `channelUser.ReadToSegment)`

@cijin In which query I’ll get the data of `channelUser.ReadToSegment` and `channelUser.lastMentionedSegment`?

---

<div class="post-metadata">

**Author:** ![cijin](https://avatars.discourse-cdn.com/v4/letter/c/49beb7/32.png) [@cijin](https://forum.social.plus/u/cijin)\
**Post date:** [March 9, 2023, 6:35am UTC](https://forum.social.plus/t/defaultchannelunread-count-always-0/663/7 "2023-03-09T06:35:02Z")

</div>

@sarathdixit

Might have been a mistake on my end. Please check, this post for details.

> [@nextPage of liveMessages not working in ts-sdk](https://forum.social.plus/t/nextpage-of-livemessages-not-working-in-ts-sdk/664/7):
>
> Hey @baodongle, As I mentioned prior, read count is a work in progress. The SDK sets localReadToSegment as messageCount - 1. It’s only a placeholder till the actual work is completed. Same goes for startReading / stopReading. The support team can keep you in the loop when the marker service is ready for use. C.C. @amitysupport

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [March 15, 2023, 8:24am UTC](https://forum.social.plus/t/defaultchannelunread-count-always-0/663/8 "2023-03-15T08:24:38Z")

</div>

Hi @sarathdixit

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.

Thank you,  
Amity Support

---

<div class="post-metadata">

**Author:** ![sarathdixit](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@sarathdixit](https://forum.social.plus/u/sarathdixit)\
**Post date:** [March 26, 2023, 9:07am UTC](https://forum.social.plus/t/defaultchannelunread-count-always-0/663/9 "2023-03-26T09:07:49Z")

</div>

@SocialPlus_Support any update on this?

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [March 27, 2023, 6:37am UTC](https://forum.social.plus/t/defaultchannelunread-count-always-0/663/10 "2023-03-27T06:37:10Z")

</div>

Hi @sarathdixit

As mentioned, this will be released by the end of this month.  
Our team is currently working as fast as we can and we’ll inform you immediately once it’s fixed.

Thank you,  
Amity Support

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [March 30, 2023, 10:21am UTC](https://forum.social.plus/t/defaultchannelunread-count-always-0/663/11 "2023-03-30T10:21:54Z")

</div>

Hi @sarathdixit

The issue should be fixed now.

Thank you,  
Amity Support
