# 3.1.0 issue & question

**URL:** <https://community.sendbird.com/t/3-1-0-issue-question/3422>\
**Category:** JavaScript\
**Created:** [November 23, 2021, 10:53am UTC](https://community.sendbird.com/t/3-1-0-issue-question/3422 "2021-11-23T10:53:34Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmilo](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/mmilo/32/1475_2.png) [@mmilo](https://community.sendbird.com/u/mmilo)\
**Post date:** [November 23, 2021, 10:53am UTC](https://community.sendbird.com/t/3-1-0-issue-question/3422/1 "2021-11-23T10:53:34Z")

</div>

Hello,

You just released v3.1.0.

Firstly, the minified file in the npm package seems to have a new dependency of the ‘dns’ npm package?

```auto
This dependency was not found:                                                                                                                            
* dns in ./node_modules/sendbird/SendBird.min.js                                                                                                          
To install it, you can run: npm install --save dns

```

Why is this and why isn’t it documented? ‘dns’ is not listed as a dependency in package.json.

Secondly, you introduced a new **localCacheEnabled** parameter to the SendBird constructor. Looking briefly through the code, this seem like a breaking change, or at least something to be aware about. Yet I don’t see any documentation anywhere? The parameter isn’t mentioned anywhere in the docs either.

Also, does this new cache functionality been tested for compatibility with SyncManager? I can imagine some conflicts if both the SendBird SDK and the SyncMaster SDK are fighting each other about being the best one to cache 🙂

---

<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:** [November 23, 2021, 4:37pm UTC](https://community.sendbird.com/t/3-1-0-issue-question/3422/2 "2021-11-23T16:37:05Z")

</div>

Hi @mmilo,

`dns` is a built in node API. There is no need for it be listed in the package.json.  
[https://nodejs.org/api/dns.html#dnslookuphostname-options-callback](https://nodejs.org/api/dns.html#dnslookuphostname-options-callback)

I updated to 3.1.0 in my own personal project and have no run into any errors. What version of node do you have installed?

In regards to localCache, this is a new feature that is just been released in 3.1.0. It will be replacing SyncManager and SyncManager will be deprecated. More documentation and announcement information to come.

---

<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:** [November 23, 2021, 5:41pm UTC](https://community.sendbird.com/t/3-1-0-issue-question/3422/3 "2021-11-23T17:41:51Z")

</div>

Documentation has been released for JavaScript here: [Local caching | Chat JavaScript SDK | Sendbird Docs](https://sendbird.com/docs/chat/v3/javascript/guides/local-caching)

---

<div class="post-metadata">

**Author:** ![Reagan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/reagan/32/1100_2.png) [@Reagan](https://community.sendbird.com/u/Reagan)\
**Post date:** [November 23, 2021, 9:29pm UTC](https://community.sendbird.com/t/3-1-0-issue-question/3422/4 "2021-11-23T21:29:19Z")

</div>

Hi @Tyler,

Unfortunately the dependency on the `dns` Node API breaks the ability to use `sendbird` on ReactNative. (The API does not exist).

Was this an intentional break? How can we continue to use `sendbird` + ReactNative?

Thanks!

---

<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:** [November 23, 2021, 9:30pm UTC](https://community.sendbird.com/t/3-1-0-issue-question/3422/5 "2021-11-23T21:30:48Z")

</div>

Hey @Reagan,

Let me connect with our Engineering team to discuss.

---

<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:** [November 24, 2021, 2:50pm UTC](https://community.sendbird.com/t/3-1-0-issue-question/3422/7 "2021-11-24T14:50:11Z")

</div>

Hi all,

We’ve released V3.1.1 that should resolve this `dns` issue. Please give it a try and report back if you run into any issues with it.

---

<div class="post-metadata">

**Author:** ![mmilo](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/mmilo/32/1475_2.png) [@mmilo](https://community.sendbird.com/u/mmilo)\
**Post date:** [November 25, 2021, 7:29pm UTC](https://community.sendbird.com/t/3-1-0-issue-question/3422/8 "2021-11-25T19:29:45Z")

</div>

Sounds good, can confirm dns dependency isn’t an issue anymore.

You should look through the new local caching docs though, already found an issue that one probably wouldn’t know how to fix, if not looking at the typescript interface.

`var groupChannelCollection = sb.GroupChannel.createChannelCollection()`

Should be `sb.GroupChannel.createGroupChannelCollection()` and since it isn’t being redeclared you should set it as a const instead 🙂

---

<div class="post-metadata">

**Author:** ![Liam\_Cho](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/liam_cho/32/724_2.png) [@Liam\_Cho](https://community.sendbird.com/u/Liam_Cho)\
**Post date:** [December 1, 2021, 8:05am UTC](https://community.sendbird.com/t/3-1-0-issue-question/3422/9 "2021-12-01T08:05:34Z")

</div>

Thank you @mmilo We will update this ASAP!

---

<div class="post-metadata">

**Author:** ![drewandre](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@drewandre](https://community.sendbird.com/u/drewandre)\
**Post date:** [December 2, 2021, 9:19pm UTC](https://community.sendbird.com/t/3-1-0-issue-question/3422/10 "2021-12-02T21:19:44Z")

</div>

Local caching isn’t working at all for us – we are using v3.1.1 and running the JS SDK in our react-native app. `sendbird.connect` just returns “Store is not available. Check your environment settings.”. Using SyncManager, we had to set the store to AsyncStorage. There must be a similar API for local caching, no?

---

<div class="post-metadata">

**Author:** ![nimeetshah](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@nimeetshah](https://community.sendbird.com/u/nimeetshah)\
**Post date:** [December 3, 2021, 9:10am UTC](https://community.sendbird.com/t/3-1-0-issue-question/3422/11 "2021-12-03T09:10:42Z")

</div>

Also running into the same issue. On iOS `sendbird.connect` just returns “Store is not available. Check your environment settings.”

---

<div class="post-metadata">

**Author:** ![drewandre](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@drewandre](https://community.sendbird.com/u/drewandre)\
**Post date:** [December 3, 2021, 2:53pm UTC](https://community.sendbird.com/t/3-1-0-issue-question/3422/12 "2021-12-03T14:53:10Z")

</div>

@Liam_Cho is the intention to support react-native local caching? And if so, is there a timeline you could share with us? We’d like to know before we migrate our chat system from syncmanager (which has been unreliable) to local caching. Thank you!

---

<div class="post-metadata">

**Author:** ![drewandre](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@drewandre](https://community.sendbird.com/u/drewandre)\
**Post date:** [December 22, 2021, 10:50pm UTC](https://community.sendbird.com/t/3-1-0-issue-question/3422/13 "2021-12-22T22:50:08Z")

</div>

So I see that v3.1.4 included a `useAsyncStorageAsDatabase` method (with zero documentation) and this has solved the “Store not available…” issue for us. But local caching is totally unreliable in our react-native app. It actually doesn’t really work at all and we feel confident we have set up the group channel and message collections appropriately.

For example, sending a message while offline returns a failed message in the `onMessageAdd` callback, but that failed message is not returned from the cache once the message collection is re-initialized. Another issue is pending file messages are not immediately returned in `onMessageAdd` – only the final, delivered message hits this handler.

The biggest issue of all is neither of the collections re-hydrate the view handlers when `sb.connect` fails. In the documentation for [local cache sendbird initialization](https://sendbird.com/docs/chat/v3/javascript/guides/migration-from-syncmanager#2-initialization-3-connect-to-sendbird-server), it claims “local caching and SyncManager ensure that your client app is operational during offline mode”. But when `sb.connect` fails, nothing is returned from cache (`onChannelAdd` is not called for example). So it just doesn’t seem to work in offline mode unless we are missing something crucial. What’s strange is in the same documentation, it _also_ claims:

> Note: If initialization fails to complete while the localCacheEnabled is set to true, the Chat SDK will operate as if the localCacheEnabled is set to false.

So… if `sb.connect` fails and the SDK operates without cache, how are we supposed to use this offline?

We’re excited about this feature but disappointed in the react-native support so far. An example app in the [sendbird js sdk examples repo](https://github.com/sendbird/sendbird-javascript-samples/tree/master/react-native) would be much appreciated.

---

<div class="post-metadata">

**Author:** ![nimeetshah](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@nimeetshah](https://community.sendbird.com/u/nimeetshah)\
**Post date:** [December 23, 2021, 4:10am UTC](https://community.sendbird.com/t/3-1-0-issue-question/3422/14 "2021-12-23T04:10:55Z")

</div>

Hi @drewandre thanks for highlighting these issues. I’m also trying to migrate to localCaching but running into issue with React Native.

I found the issue you mentioned about pending file messages not returned in the `onMessageAdd` method and told the support team about it. They were apparently going to fix this issue “early this week” but it’s already Thursday today.

I’d suggest sending an email to their support team with these issues. They seem to be more responsive there compared to the community here.
