I’ve been struggling to send a message with the SyncManager with this example code.
I can CRUD channels and messages in my view but sending doesnt work.
My code is
const send = (messageContent: string) => {
const params = new sb.UserMessageParams()
params.message = messageContent
const pendingMessage = channel.sendUserMessage(
params,
(message, error) => {
if (error) {
console.error(error)
return
}
// @TODO : what happens when message fails to send
// collection.handleSendMessageResponse(error, message)
}
)
console.log({ pendingMessage })
collection.appendMessage(pendingMessage)
}
And I get the following errors :
TypeError: Cannot assign to read only property 'pendingResolveBottom' of object '#<Object>'
TypeError: Cannot assign to read only property 'sendingStatus' of object '#<Object>
Can somebody help?