microsoft/omnichannel-chat-sdk

Unable to send message to chat bot from client

skipper09 opened this issue · 3 comments

Hello all,

I am putting this question here because I am using the sample put up in this repo for the omnichannel-chat-sdk + botframework-webchat set up.

I have copied the sample and then plugged in our companiy's org id, url, and widget id into the configuration settings into our react web app.

I am able to connect to the chat bot and receive messages from them. However, I cannot send messages. I get the "send failed, retry."

I see some CORS issues in the console/network tab.

Is this something I can fix in the client? The implementation of the chat bot itself is being handled by another team and I'm unable to see or change settings there.

image

image

What is happening is that we have app insights on our site and it is adding the following headers
access-control-request-headers: bsw-correlationid,bsw-sessionid,request-context,request-id,traceparent
which seems to be forcing an options call instead of a get call and the server is returning a 403 on the call to the connection test

https://ocsdk-prod.azureedge.net/public/connecttest.txt

Any ideas? Thanks!

I added the "no-cors" header to all requests temporarily and was able to make a GET call to the above resource. However, I'm still unable to send a message from a user.

In the debug messages in the console, the message status is simply "failed." I'll post a screenshot shortly.

I made sure I'm on the same versions of the two npm packages required for this. The sample runs fine.

failed message send from our client:
image

successful message send from sample:
image

I also see this in the console in our client but not in the sample:
image

@ferodom I believe app insights' custom headers is preventing messages to be sent. A potential solution would be not to send these headers on those calls.

FYI GET https://ocsdk-prod.azureedge.net/public/connecttest.txt does not require an OPTIONS call which explains why it failed.