Skip to content

craete-new-sms fuction is sending 2 SMS #4

@ruipfreis

Description

@ruipfreis

I've noticed that as soon as there is a Flex Task created, in my case that happens when a client sends/replies to a SMS, the following bit of code sends duplicated SMS until the Task is completed.

client.messages.create({ body: event.Message, to: to, from: from }).then(() => { console.log('adding message to', channelResponse.data.sid); client.chat.services(context.CHAT_SERVICE_SID) .channels(channelResponse.data.sid) .messages .create({ body: event.Message, from: from }).then(() => callback(null, response)); }).catch(err => { console.error(err); callback(err); });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions