# \[MessageCollection\] Chat SDK v4 migration problem

**URL:** <https://community.sendbird.com/t/messagecollection-chat-sdk-v4-migration-problem/4490>\
**Category:** JavaScript\
**Created:** [April 20, 2022, 8:05am UTC](https://community.sendbird.com/t/messagecollection-chat-sdk-v4-migration-problem/4490 "2022-04-20T08:05:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Cheng](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/peter_cheng/32/1814_2.png) [@Peter\_Cheng](https://community.sendbird.com/u/Peter_Cheng)\
**Post date:** [April 20, 2022, 8:05am UTC](https://community.sendbird.com/t/messagecollection-chat-sdk-v4-migration-problem/4490/1 "2022-04-20T08:05:06Z")

</div>

After I upgrade sdk from v3 to v4, some messages are disappeared.

“@sendbird/chat”: “4.0.0-beta.4”

```auto
const messageCollection: MessageCollection = ...
collection
      .initialize(MessageCollectionInitPolicy.CACHE_AND_REPLACE_BY_API)
      .onApiResult((e, messages) => {
           // v3 messages count = 9
           // v4 messages count = 0
      })
      ....

---------------------------------------
const channel: GroupChannel = ...
const messages = await channel.getMessagesByTimestamp(...);
console.log(messages.length);
// v3 messages count = 9
// v4 messages count = 9

```

---

<div class="post-metadata">

**Author:** ![hewong](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/hewong/32/1817_2.png) [@hewong](https://community.sendbird.com/u/hewong)\
**Post date:** [June 29, 2022, 4:17am UTC](https://community.sendbird.com/t/messagecollection-chat-sdk-v4-migration-problem/4490/2 "2022-06-29T04:17:12Z")

</div>

I’m facing the same issue here. When using v3 there was no problem. I’ve also verified with Platform API and confirmed that those missing messages indeed exist.
