# addReaction cause an error without description

**URL:** <https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675>\
**Category:** Miscellaneous\
**Tags:** group-channel, react-native\
**Created:** [May 17, 2022, 10:38am UTC](https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675 "2022-05-17T10:38:04Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![aleksandr.bolshakov](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@aleksandr.bolshakov](https://community.sendbird.com/u/aleksandr.bolshakov)\
**Post date:** [May 17, 2022, 10:38am UTC](https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675/1 "2022-05-17T10:38:05Z")

</div>

Hi!  
I’m using “sendbird”: “3.1.9” at React Native project, when I’m trying to addReaction I’m getting an error without description what is the problem

 ![image](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/2/258e67fcd590ac584ce1d7e1f4118a6ca57178d4.png)

---

<div class="post-metadata">

**Author:** ![aleksandr.bolshakov](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@aleksandr.bolshakov](https://community.sendbird.com/u/aleksandr.bolshakov)\
**Post date:** [May 17, 2022, 10:38am UTC](https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675/2 "2022-05-17T10:38:53Z")

</div>

![Screenshot 2022-05-17 at 12.35.14](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/3/309a6a842be19de890e1c1372da4f45b61b107fa.png)

---

<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:** [May 18, 2022, 4:34am UTC](https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675/3 "2022-05-18T04:34:30Z")

</div>

Hi @aleksandr.bolshakov, it looks like maybe the order of the callback parameters is reversed. The “error” you received is actually a successful response.

Is this the only function that returns results in this order? Meaning its structured as (event, err) but is returned (err, event)?

---

<div class="post-metadata">

**Author:** ![aleksandr.bolshakov](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@aleksandr.bolshakov](https://community.sendbird.com/u/aleksandr.bolshakov)\
**Post date:** [May 21, 2022, 10:14pm UTC](https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675/4 "2022-05-21T22:14:15Z")

</div>

Hi, @Tyler  
may be but I used it as documentaion says

```auto
from /sendbird/SendBird.d.ts:
 
 type reactionEventCallback = (event: ReactionEvent, error: SendBirdError) => void;

```

and reactions array from message remains empty

---

<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:** [May 25, 2022, 10:51pm UTC](https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675/5 "2022-05-25T22:51:46Z")

</div>

Hi @aleksandr.bolshakov,

My apologies for my delayed response. I totally understand that you followed the documentation. Ideally I’m just checking to see if you get the correct information if you flip them. I tested this in my own sample application and I was getting the correct order in a non React-Native environment so I need to test in React Native.

---

<div class="post-metadata">

**Author:** ![aleksandr.bolshakov](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@aleksandr.bolshakov](https://community.sendbird.com/u/aleksandr.bolshakov)\
**Post date:** [May 26, 2022, 1:48pm UTC](https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675/6 "2022-05-26T13:48:51Z")

</div>

@Tyler

 ![Screenshot 2022-05-26 at 15.44.51](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/b/b471e4609941b24f87812d695b9b1428286df2d8.png)

---

<div class="post-metadata">

**Author:** ![aleksandr.bolshakov](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@aleksandr.bolshakov](https://community.sendbird.com/u/aleksandr.bolshakov)\
**Post date:** [May 26, 2022, 1:49pm UTC](https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675/7 "2022-05-26T13:49:28Z")

</div>

@Tyler

 ![Screenshot 2022-05-26 at 15.44.23](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/7/776f73e61aad49ff63ad17af9e6d36ae6bf3fc39.png)

---

<div class="post-metadata">

**Author:** ![aleksandr.bolshakov](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@aleksandr.bolshakov](https://community.sendbird.com/u/aleksandr.bolshakov)\
**Post date:** [May 26, 2022, 1:50pm UTC](https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675/8 "2022-05-26T13:50:38Z")

</div>

@Tyler this is the message I’m trying to add a reaction to

 ![Screenshot 2022-05-26 at 15.42.25](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/1/1961a9ea70b8607bd219e6cd526cbf64c8b96395.png)

---

<div class="post-metadata">

**Author:** ![aleksandr.bolshakov](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@aleksandr.bolshakov](https://community.sendbird.com/u/aleksandr.bolshakov)\
**Post date:** [May 26, 2022, 1:51pm UTC](https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675/9 "2022-05-26T13:51:13Z")

</div>

@Tyler After message I refetched messages and ` reactions: [],`

---

<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:** [May 26, 2022, 11:59pm UTC](https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675/10 "2022-05-26T23:59:24Z")

</div>

Hi @aleksandr.bolshakov,

Looks like I’ll need to do some reproducing of the issue in my own environment. One thing I might suggest, is inspecting the network request that is being sent to see if it actually includes the data you’re expecting. I’ll report back once I’ve had a chance to try and reproduce this.

---

<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:** [May 31, 2022, 3:52am UTC](https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675/11 "2022-05-31T03:52:14Z")

</div>

Just wanted to touch base on this topic. I was able to reproduce this in React-Native and am currently working with our Engineering team to understand what is going on.

---

<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 7, 2022, 6:33am UTC](https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675/12 "2022-06-07T06:33:42Z")

</div>

Hey @aleksandr.bolshakov,

Just wanted to touch base on this. Are you calling `sb.setErrorFirstCallback(true)` anywhere? I went back and look at our sample, and it is setting that which is why I was able to reproduce this. By removing it, I’m no longer able to reproduce this issue.

---

<div class="post-metadata">

**Author:** ![aleksandr.bolshakov](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@aleksandr.bolshakov](https://community.sendbird.com/u/aleksandr.bolshakov)\
**Post date:** [June 9, 2022, 1:03pm UTC](https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675/13 "2022-06-09T13:03:11Z")

</div>

> [@Tyler](#):
>
> setErrorFirstCallback

Hi @Tyler !  
Thank you for your help!  
yes with removing this `sb.setErrorFirstCallback(true)` problem goes away BUT I still getting empty reactions array when fetching messages ☹  
how it’s looks like:

1. I sending reaction,got no error and reactionEvent:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/d/dd3ca32fed09343f8617a678c6b8bf66e168fc73.png)
2. call ` message.applyReactionEvent(reactionEvent);`
3. but when I refetching messages, at this message `rections` array sill empty

---

<div class="post-metadata">

**Author:** ![aleksandr.bolshakov](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@aleksandr.bolshakov](https://community.sendbird.com/u/aleksandr.bolshakov)\
**Post date:** [June 9, 2022, 1:03pm UTC](https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675/14 "2022-06-09T13:03:45Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/7/77ee31de5b7c3c367130390e97b4a5b1bca7887f.png)

---

<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 14, 2022, 7:55am UTC](https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675/15 "2022-06-14T07:55:59Z")

</div>

Hi @aleksandr.bolshakov,

Apologize for my delayed response. When you generate your listQuery, are you passing in `includeReaction = true`?

An example like:

```auto
const listQuery = groupChannel.createPreviousMessageListQuery();
listQuery.limit = LIMIT;
listQuery.reverse = REVERSE;
listQuery.includeReaction = true; // Retrieve a list of messages along with their reactions.

```

---

<div class="post-metadata">

**Author:** ![aleksandr.bolshakov](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@aleksandr.bolshakov](https://community.sendbird.com/u/aleksandr.bolshakov)\
**Post date:** [June 17, 2022, 8:03am UTC](https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675/16 "2022-06-17T08:03:59Z")

</div>

Hi @Tyler!  
Sorry for long response, yes I am passing `includeReaction = true`

---

<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 17, 2022, 8:19am UTC](https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675/17 "2022-06-17T08:19:38Z")

</div>

Hi @aleksandr.bolshakov,

Can you share with me your entire createPreviousMessageListQuery? Also, can you console it out as well and confirm that it is in fact being set to true?

---

<div class="post-metadata">

**Author:** ![aleksandr.bolshakov](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@aleksandr.bolshakov](https://community.sendbird.com/u/aleksandr.bolshakov)\
**Post date:** [June 17, 2022, 10:22am UTC](https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675/18 "2022-06-17T10:22:34Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/c/cef3fed6815935302651cae69c5c5116aefd459d.png)

---

<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 17, 2022, 10:58am UTC](https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675/19 "2022-06-17T10:58:39Z")

</div>

@aleksandr.bolshakov,

I’m able to reproduce this behavior in my own application. When I react to a message, I can see the message when I fetch the message list so long as `includeReactions` is true.

Is this occurring in a production app or staging app?

For transparency sake here is my test:

```auto
const params = new sendbird.MessageListParams();
    params.isInclusive = true;
    params.includeReactions = true;
    channel.getMessagesByMessageId(1915615880, params, (messages, error) => {
      if (error) {
        console.error('WE ERRORED ON THIS', error);
      } else {
        console.log('-----------------------------');
        console.log(JSON.stringify(messages[0], null, 2));
        console.log('-----------------------------');
      }
    });

```

Which outputs:

```auto
 LOG -----------------------------
 LOG {
  "messageId": 1915615880,
  "messageType": "user",
  "channelUrl": "sendbird_group_channel_71815291_42f02f6711993591c5e4cfad473e882686eea0ce",
  "data": "",
  "customType": "",
  "silent": false,
  "createdAt": 1655372815096,
  "updatedAt": 0,
  "channelType": "group",
  "metaArrays": [],
  "reactions": [
    {
      "key": "👍",
      "userIds": [
        "testUser02"
      ],
      "updatedAt": 1655380310954,
      "_version": {
        "testUser02": 1655380310954
      }
    }
  ],
  "mentionType": "users",
  "mentionedUsers": [],
  "mentionedUserIds": [],
  "mentionedMessageTemplate": null,
  "sendingStatus": "succeeded",
  "parentMessageId": 0,
  "parentMessageText": null,
  "threadInfo": {
    "replyCount": 0,
    "mostRepliedUsers": [],
    "lastRepliedAt": 0,
    "updatedAt": 0
  },
  "isReplyToChannel": false,
  "parentMessage": null,
  "ogMetaData": null,
  "isOperatorMessage": false,
  "appleCriticalAlertOptions": null,
  "reqId": "1655372773101",
  "_isAutoResendRegistered": false,
  "message": "Hello World. This is a message with chat history enabled.",
  "_sender": {
    "nickname": "Admin",
    "plainProfileUrl": "https://randomuser.me/api/portraits/men/46.jpg",
    "userId": "Admin",
    "connectionStatus": "nonavailable",
    "lastSeenAt": 0,
    "metaData": {},
    "isActive": true,
    "friendDiscoveryKey": null,
    "friendName": null,
    "_preferredLanguages": null,
    "requireAuth": false,
    "role": "none",
    "isBlockedByMe": false
  },
  "translations": {},
  "requestState": "succeeded",
  "requestedMentionUserIds": [],
  "errorCode": 0,
  "messageSurvivalSeconds": -1,
  "plugins": [],
  "poll": null,
  "_messageParams": null
}
 LOG -----------------------------

```

---

<div class="post-metadata">

**Author:** ![aleksandr.bolshakov](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@aleksandr.bolshakov](https://community.sendbird.com/u/aleksandr.bolshakov)\
**Post date:** [June 29, 2022, 9:34am UTC](https://community.sendbird.com/t/addreaction-cause-an-error-without-description/4675/20 "2022-06-29T09:34:54Z")

</div>

Issue solved!  
Thanks!  
Also  
`params.includeReactions = true;`  
should be added to the  
`getMessagesByMessageId`
