chat-sdk-javascript icon indicating copy to clipboard operation
chat-sdk-javascript copied to clipboard

message listeners are getting called multiple times after new message arrives

Open mannenikhil opened this issue 5 years ago • 2 comments

Describe the problem

listeners getting called twice after each message arrives and leading to calling the api's twice

What was the expected behavior?

listeners should be called only once for each message

Reproduction

const messageListener = 'messageListener'; CometChat.addMessageListener( messageListener, new CometChat.MessageListener({ onTextMessageReceived: (textMessage) => { console.log('message listener'); this.playAudio(textMessage); this.updateDataOnMessageReceived(textMessage); }, onMediaMessageReceived: (mediaMessage) => { this.playAudio(mediaMessage); this.updateDataOnMessageReceived(mediaMessage); }, }), )

Environment

Please provide the following:

  • **Version used:2.1.1
  • Other modules/plugins/libraries that might be involved:

mannenikhil avatar Jun 25 '21 08:06 mannenikhil

Hello @mannenikhil,

You are using a very old version. Please try updating the SDK to the latest version v2.3.6. Please let us know if this solves your issue.

mayur-bhandari avatar Jun 25 '21 15:06 mayur-bhandari

Hi @mannenikhil,

Hope the issue has been resolved post upgrading. If you need further help with this, please feel free to write to [email protected].

Regards, Provesha

proveshapyne avatar Jun 30 '21 14:06 proveshapyne