I’ve reviewed my code and everything appears to be correct. The error seems to originate directly from the SDK. I also checked the payload passed to createMessage, which looks like this:
I suspect the issue might be linked to the updateSubChannelCache and shallowClone functions - @amityco/ts-sdk/src/subChannelRepository/utils/updateSubChannelCache.ts
SDK version: 6.33.0
Although creating a new chat and sending a message work correctly, we consistently see this error whenever we initiate a chat with a new message. Has anyone encountered a similar issue or knows why this might be happening?
Hello @Radek , We are unable to reproduce this issue on our end. Could you kindly provide a screen recording along with step-by-step details on how to replicate the issue? This will help us conduct a more thorough investigation. Thank you.
Could you confirm whether you are using our UIKit or implementing your own app?
If you are implementing it on your own, could you share the sequence of SDK API calls when initiating a new chat? Specifically, have you called .getMessage() before .createMessage()?
This will help us better understand the implementation and investigate further. Looking forward to your response!
Hey @SocialPlus_Support,
We implement our own app with your SDK (without any UIKit). Also here I leave the sequence of SDK API calls once I decide to create a new chat and I add 2 members to with sending a message (First I create a new chat, then I add 2 users to it, and at the end I send a message).
User creates a new chat
a. User selects any user from the list
b. Once he selects one user, we trigger ChannelRepository.createChannel() with type conversation
c. Then we trigger MessageRepository.getMessages
User adds another user to group (second member)
a. Once he adds new member, we trigger change type to community
b. We trigger ChannelRepository.Membership.getMembers
User sends a message by typing something in the input
a. We trigger MessageRepository.createMessage
b. Then we trigger MessageRepository.getMessages
c. Now user sees working chat with new input
d. The issue with console.error() appears