# Error from Chat SDK when calling "buildFromSerializedData" on a message with reactions

**URL:** <https://community.sendbird.com/t/error-from-chat-sdk-when-calling-buildfromserializeddata-on-a-message-with-reactions/1194>\
**Category:** Sendbird Chat API/SDK\
**Tags:** group-channel, chatsdk\
**Created:** [October 27, 2020, 3:08pm UTC](https://community.sendbird.com/t/error-from-chat-sdk-when-calling-buildfromserializeddata-on-a-message-with-reactions/1194 "2020-10-27T15:08:51Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![SamKK](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@SamKK](https://community.sendbird.com/u/SamKK)\
**Post date:** [October 27, 2020, 3:08pm UTC](https://community.sendbird.com/t/error-from-chat-sdk-when-calling-buildfromserializeddata-on-a-message-with-reactions/1194/1 "2020-10-27T15:08:51Z")

</div>

So this is a difficult one…

On our chat system, when we receive messages, we store them in indexdb, before storing them, we call serialize() on the message. When we pull them out of the store, we call buildFromSerializedData(message).

This works… up until a reaction is added to the message.  
At first i thought it was something to do with us storing in indexdb… so i wrote a script in chrome sources panel. It turns out it is an issue with the chat sdk.

You can view the script here:

> **[ShotSaver](https://shotsaver.io/file/CZRSry7OT1DAoC3G)**
>
> Code uploaded to ShotSaver by Sam

  
It’s pretty rough/hacky, but i just wanted to be 100% sure it wasn’t something weird caused by our implementation. It tests the raw use case without anything external taking control.

We have built our own “sync manager” to handle our extended use cases. So the way we access sendbird in this case is via that, but this code follows sendbirds documentation on how to implement reactions.

Have I done something wrong or is this an SDK issue?

Error from the SDK is:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/1X/38be96c41e64921d7c0bf4aaeb5ce34f6f738622.png)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/1X/693556916d60aaac957ac1828b326d9fd64f72f5.png)

---

<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:** [October 27, 2020, 3:13pm UTC](https://community.sendbird.com/t/error-from-chat-sdk-when-calling-buildfromserializeddata-on-a-message-with-reactions/1194/2 "2020-10-27T15:13:32Z")

</div>

Can you share one sample object you’re trying to serialize?

---

<div class="post-metadata">

**Author:** ![SamKK](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@SamKK](https://community.sendbird.com/u/SamKK)\
**Post date:** [October 27, 2020, 3:17pm UTC](https://community.sendbird.com/t/error-from-chat-sdk-when-calling-buildfromserializeddata-on-a-message-with-reactions/1194/3 "2020-10-27T15:17:07Z")

</div>

I’m currently streaming on twitch if it would be easier to run through anything in real-time with you?

If not, any preference on how i show you this data? printscreen, json?

---

<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:** [October 27, 2020, 3:20pm UTC](https://community.sendbird.com/t/error-from-chat-sdk-when-calling-buildfromserializeddata-on-a-message-with-reactions/1194/4 "2020-10-27T15:20:06Z")

</div>

Maybe a JSON object rather than a printscreen so I can take a look at its elements. Thanks.

---

<div class="post-metadata">

**Author:** ![SamKK](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@SamKK](https://community.sendbird.com/u/SamKK)\
**Post date:** [October 27, 2020, 3:25pm UTC](https://community.sendbird.com/t/error-from-chat-sdk-when-calling-buildfromserializeddata-on-a-message-with-reactions/1194/5 "2020-10-27T15:25:36Z")

</div>

No problem;

One before applyReactionEvent()

> **[ShotSaver](https://shotsaver.io/file/oW0OOnwiyHZCM9Se)**
>
> Code uploaded to ShotSaver by Sam

One after applyReactionEvent()

> **[ShotSaver](https://shotsaver.io/file/9oZuTLEtZrhHqLgT)**
>
> Code uploaded to ShotSaver by Sam

One of the object after serialize() is called

> **[ShotSaver](https://shotsaver.io/file/GpSeLLxnLgaZvv5l)**
>
> Code uploaded to ShotSaver by Sam

---

<div class="post-metadata">

**Author:** ![SamKK](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@SamKK](https://community.sendbird.com/u/SamKK)\
**Post date:** [October 27, 2020, 3:27pm UTC](https://community.sendbird.com/t/error-from-chat-sdk-when-calling-buildfromserializeddata-on-a-message-with-reactions/1194/6 "2020-10-27T15:27:32Z")

</div>

Sorry 1 minute, i might have got those previews mixed up 😑

---

<div class="post-metadata">

**Author:** ![SamKK](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@SamKK](https://community.sendbird.com/u/SamKK)\
**Post date:** [October 27, 2020, 3:32pm UTC](https://community.sendbird.com/t/error-from-chat-sdk-when-calling-buildfromserializeddata-on-a-message-with-reactions/1194/7 "2020-10-27T15:32:33Z")

</div>

Before:

> **[ShotSaver](https://shotsaver.io/file/yqhXvkIzREU90tc4)**
>
> Code uploaded to ShotSaver by Sam

After:

> **[ShotSaver](https://shotsaver.io/file/LrQQGcaZXnmB4R6A)**
>
> Code uploaded to ShotSaver by Sam

Serialized:

> **[ShotSaver](https://shotsaver.io/file/O9ArQ3IQNH6XJwcE)**
>
> Code uploaded to ShotSaver by Sam

VSCode overwrote the other files somehow, here are the correct ones

---

<div class="post-metadata">

**Author:** ![SamKK](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@SamKK](https://community.sendbird.com/u/SamKK)\
**Post date:** [October 27, 2020, 3:38pm UTC](https://community.sendbird.com/t/error-from-chat-sdk-when-calling-buildfromserializeddata-on-a-message-with-reactions/1194/8 "2020-10-27T15:38:36Z")

</div>

As a side question;

Would it be possible for us to access some sendbird functions without a specific sendbird handled object?

For example, with channels and their object from the SDK. They have methods like  
getPushPreference  
startTyping etc

If we were to build our own object and manage it’s state for channels and messages. Can we access these methods a different way or are they private and can only be called explicitly on a sendbird object?

This would solve our issue, it’s not the first time we’ve been held up with a serialization issue like this one

---

<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:** [October 27, 2020, 4:09pm UTC](https://community.sendbird.com/t/error-from-chat-sdk-when-calling-buildfromserializeddata-on-a-message-with-reactions/1194/9 "2020-10-27T16:09:39Z")

</div>

Would it be in any help instead of serializing objects, get all its details using Platform API?

> **[Messages | Platform API Chat SDK Documentation | Sendbird](https://docs.sendbird.com/platform/messages#3_view_a_message)**
>
> The following APIs can help you manage messages from your server-side. There are three types: Text message and file message are sent by users in a channel, while an admin message is sent only by an admin user through Chat Platform API or Sendbird...

About functions like typing indicators, have you checked here?

> **[Group Channel Advanced | JavaScript Chat SDK Documentation | Sendbird](https://docs.sendbird.com/javascript/group_channel_advanced#3_send_typing_indicators_to_other_members)**
>
> This page explains the advanced features for group channels. Some of them are the premium features available only to a paying user.

---

<div class="post-metadata">

**Author:** ![SamKK](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@SamKK](https://community.sendbird.com/u/SamKK)\
**Post date:** [October 27, 2020, 4:21pm UTC](https://community.sendbird.com/t/error-from-chat-sdk-when-calling-buildfromserializeddata-on-a-message-with-reactions/1194/10 "2020-10-27T16:21:11Z")

</div>

We could possibly go that route with pulling messages/channels this way… it just relies on our server and scaling that up, rather than utilizing the service we pay for to it’s full extent

With the typing indicators though for example; We could only trigger “startTyping” “endTyping” via a sendbird object though correct?  
sendbird.GroupChannel.cachedChannels[id].startTyping()

There is no static method like “markAsDelivered” has?  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/1X/d6a8c846cd8c385c2e217a68023b7dc3a1cd1fdc.png)

I also can’t see any endpoint to trigger typing status via platform api neither

---

<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:** [October 27, 2020, 4:23pm UTC](https://community.sendbird.com/t/error-from-chat-sdk-when-calling-buildfromserializeddata-on-a-message-with-reactions/1194/11 "2020-10-27T16:23:46Z")

</div>

You’re correct. That’s the only way to send typing commands.

---

<div class="post-metadata">

**Author:** ![SamKK](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@SamKK](https://community.sendbird.com/u/SamKK)\
**Post date:** [October 27, 2020, 4:34pm UTC](https://community.sendbird.com/t/error-from-chat-sdk-when-calling-buildfromserializeddata-on-a-message-with-reactions/1194/12 "2020-10-27T16:34:44Z")

</div>

So what do we do? 🤔

We’re about a year deep in development with Senbird and have native ios/android apps built around it too

If we can’t rely on serialization, cant use sendbird syncmanager for our other edge-cases and we can’t call certain methods unless we do. It’s almost left us at a dead end from a tech perspective…

---

<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:** [October 27, 2020, 4:50pm UTC](https://community.sendbird.com/t/error-from-chat-sdk-when-calling-buildfromserializeddata-on-a-message-with-reactions/1194/13 "2020-10-27T16:50:14Z")

</div>

I can open a ticket and see more about the serialization error you have in your screenshot.

You mentioned that Sendbird’s SyncManager does not have some functions you need, correct? Can you please describe them? I can check if there’s a way to do what you need using Sendbird’s SyncManager.

---

<div class="post-metadata">

**Author:** ![SamKK](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@SamKK](https://community.sendbird.com/u/SamKK)\
**Post date:** [October 27, 2020, 4:56pm UTC](https://community.sendbird.com/t/error-from-chat-sdk-when-calling-buildfromserializeddata-on-a-message-with-reactions/1194/14 "2020-10-27T16:56:53Z")

</div>

I would appreciate that

There was these issues in this thread  
We also had some weird scenario where unless we got two versions matching by incrementing the version number on each package, they would not communicate correctly and all sorts of random errors were being thrown  
We also ideally needed a way to attach some additional data to be stored in indexdb, without having to save the data on the “data” object of a channel/message

Ultimately we couldn’t find a way and built our own solution that worked really well up until we decided to implement Reactions

> [@SendBird Sync Manager issues](https://community.sendbird.com/t/sendbird-sync-manager-issues/870):
>
> I’m not sure if it’s something wrong with my implementation or an actual error with the package. Everything else except these two cases work perfectly. When I add a user to a channel, SendBird SyncManager throws this error: SendBirdSyncManager.min.js?6534:6 Uncaught TypeError: Cannot read property ‘userId’ of null at eval (SendBirdSyncManager.min.js?6534:6) at eval (SendBirdSyncManager.min.js?6534:6) at IDBRequest.e.onsuccess (SendBirdSyncManager.min.js?6534:6) When I delete a message from…

I also just found that I can do this to send a typing notification; Any hints or anything against me using this?

```
let ch = new sendbird.GroupChannel();
ch.url = 'bf7ea026-6379-4642-b5c8-633e9eb6d661';
ch.startTyping();

```

It seems to send a socket event, but I can’t test if i can receive it at the moment

---

<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:** [October 27, 2020, 5:05pm UTC](https://community.sendbird.com/t/error-from-chat-sdk-when-calling-buildfromserializeddata-on-a-message-with-reactions/1194/15 "2020-10-27T17:05:08Z")

</div>

For the last part (the startTyping()), sorry if I was not clear on this but this is exactly what I wanted to point out 😊

To test it you should add a handler. check here:

> **[Event Handler | JavaScript Chat SDK Documentation | Sendbird](https://docs.sendbird.com/javascript/event_handler#2_event_handler)**
>
> Sendbird Chat SDK for JavaScript provides three types of event handlers for your client apps: \[object Object\], \[object Object\], and \[object Object\]. Through the channel event handler and user event handler, Sendbird server notifies online client apps...
