# SyncManager: after initial caching, message collection handler only called with initial messages

**URL:** <https://community.sendbird.com/t/syncmanager-after-initial-caching-message-collection-handler-only-called-with-initial-messages/2408>\
**Category:** JavaScript\
**Created:** [June 6, 2021, 3:11pm UTC](https://community.sendbird.com/t/syncmanager-after-initial-caching-message-collection-handler-only-called-with-initial-messages/2408 "2021-06-06T15:11:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrick.span](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/patrick.span/32/1303_2.png) [@patrick.span](https://community.sendbird.com/u/patrick.span)\
**Post date:** [June 6, 2021, 3:11pm UTC](https://community.sendbird.com/t/syncmanager-after-initial-caching-message-collection-handler-only-called-with-initial-messages/2408/1 "2021-06-06T15:11:58Z")

</div>

Hello,

I’m experiencing an issue with SyncManager on React native where the first time the app is opened, the messages are cached and `onSucceededMessageEvent` is called with all messages in a channel.

However, after sending a message, closing the app, and re-opening it, `onSucceededMessageEvent` is still called with the same messages, not including the new one.

Yet, the debug console shows that all messages are fetched from the server, including the new one. If I reset the cache and async storage, then it works and fetches all messages including the new one.

I’m using the following versions:

```auto
"react-native": "^0.63.4",
"sendbird": "^3.0.151",
"sendbird-syncmanager": "^1.1.26",

```

Here is my implementation: [Sendbird issue with SyncManager · GitHub](https://gist.github.com/patrick-samy/823556da81fc837c339f75ef725ae6d6)

Any ideas?

---

<div class="post-metadata">

**Author:** ![walter.rodriguez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/walter.rodriguez/32/546_2.png) [@walter.rodriguez](https://community.sendbird.com/u/walter.rodriguez)\
**Post date:** [June 7, 2021, 4:28pm UTC](https://community.sendbird.com/t/syncmanager-after-initial-caching-message-collection-handler-only-called-with-initial-messages/2408/2 "2021-06-07T16:28:11Z")

</div>

Thanks @patrick.span Reporting internally.

---

<div class="post-metadata">

**Author:** ![patrick.span](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/patrick.span/32/1303_2.png) [@patrick.span](https://community.sendbird.com/u/patrick.span)\
**Post date:** [June 9, 2021, 12:59pm UTC](https://community.sendbird.com/t/syncmanager-after-initial-caching-message-collection-handler-only-called-with-initial-messages/2408/3 "2021-06-09T12:59:15Z")

</div>

Thanks @walter.rodriguez. Any updates and timeframe to resolve if it’s an issue in the SyncManager code?

If it’s more than a week and there’s no workaround, we’ll go to production without SyncManager first.

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [June 9, 2021, 1:04pm UTC](https://community.sendbird.com/t/syncmanager-after-initial-caching-message-collection-handler-only-called-with-initial-messages/2408/4 "2021-06-09T13:04:20Z")

</div>

Hi @patrick.span,

It will likely take some time to investigate and determine a fix, and so it may be best to plan without it for now.

---

<div class="post-metadata">

**Author:** ![walter.rodriguez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/walter.rodriguez/32/546_2.png) [@walter.rodriguez](https://community.sendbird.com/u/walter.rodriguez)\
**Post date:** [June 11, 2021, 2:12pm UTC](https://community.sendbird.com/t/syncmanager-after-initial-caching-message-collection-handler-only-called-with-initial-messages/2408/5 "2021-06-11T14:12:43Z")

</div>

@patrick.span I was trying to build some test code according to your implementation.  
Can you please check this code and confirm that it’s the same as you have there? I just did it for anyone to try it… Just need an application ID, user ID and a channel URL to send messages.

> <https://github.com/warodri-sendbird/syncmanager-react-native/blob/main/src/App.js>

Can you please clone it and let me know if this error happens there? Thanks!

---

<div class="post-metadata">

**Author:** ![Matan\_Fried](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/matan_fried/32/1311_2.png) [@Matan\_Fried](https://community.sendbird.com/u/Matan_Fried)\
**Post date:** [July 12, 2021, 11:04am UTC](https://community.sendbird.com/t/syncmanager-after-initial-caching-message-collection-handler-only-called-with-initial-messages/2408/6 "2021-07-12T11:04:58Z")

</div>

Hi walter, i’m trying to reproduce the issue with the code above, note that this issue is occurring in react-native, the code you have provided is for react, not react-native, it is impossible to reproduce the bug because the app behaves differently while setting it to the background and then to foreground on android makes the onSucceededMessageEvent unreachable, please provide a react-native project
