# Messages not updated even already subscribed subchannel

**URL:** <https://forum.social.plus/t/messages-not-updated-even-already-subscribed-subchannel/1596>\
**Category:** TS SDK\
**Created:** [February 4, 2025, 8:56am UTC](https://forum.social.plus/t/messages-not-updated-even-already-subscribed-subchannel/1596 "2025-02-04T08:56:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![new.suppawit](https://avatars.discourse-cdn.com/v4/letter/n/848f3c/32.png) [@new.suppawit](https://forum.social.plus/u/new.suppawit)\
**Post date:** [February 4, 2025, 8:56am UTC](https://forum.social.plus/t/messages-not-updated-even-already-subscribed-subchannel/1596/1 "2025-02-04T08:56:29Z")

</div>

I have implemented live chat application as web app. I using getMessages function from sdk to get the collection of messages. I also create code to subscribed the subchannel to get an updated collection of message but messages seem not updated. The callback function is not even trigger when new message was send by other devices. The messages will be updated only when refresh the page or send the new message (message will be updated only in its application).

here is my code

```auto
useEffect(() => {
    if (isJoinedChannel && subChannel) {
      const unsubscribe = MessageRepository.getMessages(
        { subChannelId: subChannel.subChannelId, limit: 100 },
        ({ data: messages, onNextPage, hasNextPage, loading, error }) => {
          console.log('Callback triggered:', { messages, loading, error })
          if (error) {
            logger.error('Messages Error:', error)
            return
          }
          if (loading) {
            logger.info('Messages Loading...')
            return
          }
          if (messages) {
            logger.success('Messages Received:', messages)
            if (messages.length > 0) {
              setMessages(messages)
            }
            subscribeSubChannelTopic()
          }
        }
      )

      disposers.push(unsubscribe)

      return () => {
        disposers.forEach((fn) => fn())
      }
    }
  }, [isJoinedChannel, subChannel])

const subscribeSubChannelTopic = async () => {
    if (subChannel) {
      const unsubscribe = subscribeTopic(getSubChannelTopic(subChannel))
      console.log('Subscribed to SubChannel Topic', unsubscribe)
      disposers.push(unsubscribe)
    }
  }

```

sdk: @amityco/ts-sdk (6.33.1)  
framework: nextjs (15.1.4)

Not sure if I did something wrong?

---

<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:** [February 4, 2025, 10:52am UTC](https://forum.social.plus/t/messages-not-updated-even-already-subscribed-subchannel/1596/2 "2025-02-04T10:52:07Z")

</div>

Hello @new.suppawit , thank you for providing all the information. We have forwarded it to our team, and we’ll keep you updated on any progress.

---

<div class="post-metadata">

**Author:** ![new.suppawit](https://avatars.discourse-cdn.com/v4/letter/n/848f3c/32.png) [@new.suppawit](https://forum.social.plus/u/new.suppawit)\
**Post date:** [February 5, 2025, 7:17am UTC](https://forum.social.plus/t/messages-not-updated-even-already-subscribed-subchannel/1596/3 "2025-02-05T07:17:43Z")

</div>

Seems like it will not working only in SG region 🤔

---

<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:** [February 6, 2025, 4:45am UTC](https://forum.social.plus/t/messages-not-updated-even-already-subscribed-subchannel/1596/4 "2025-02-06T04:45:12Z")

</div>

Hello @new.suppawit , We apologize for the inconvenience. We have applied a potential fix on our end. Could you please retest and let us know if the issue still persists?
