BotFramework-WebChat icon indicating copy to clipboard operation
BotFramework-WebChat copied to clipboard

Web Chat shows retry but message is really sent to bot

Open alokraj68 opened this issue 9 years ago • 36 comments

Hi, The web chat is showing could not send please retry, but the message is really sent to bot. what really goes wrong is that user will press retry and the bot will get the message every time the retry is pressed.

alokraj68 avatar May 17 '17 06:05 alokraj68

I am having the same issue. My bot is doing image analysis so it could take up to 10 seconds to respond.

forceamp avatar May 19 '17 18:05 forceamp

Yeah! And also, if we open the same web chat in 2 tabs lets say the bot is present over a website it will throw 412 precondition failed. Which again breaks the conversation.

On 20-May-2017 12:28 AM, "forceamp" [email protected] wrote:

I am having the same issue. My bot is doing image analysis so it could take up to 10 seconds to respond.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Microsoft/BotFramework-WebChat/issues/465#issuecomment-302784327, or mute the thread https://github.com/notifications/unsubscribe-auth/AIyDm79hH3OvMvJuYGCVya15Jrs5aOsLks5r7eZBgaJpZM4NdbiG .

alokraj68 avatar May 20 '17 05:05 alokraj68

Other channels allow 15 seconds to respond. It would be nice if webchat abided this timeout too.

ohmusama avatar May 23 '17 17:05 ohmusama

How quickly is "retry" shown? Which SDK are you using?

DirectLineJS (which is what WebChat uses) actually observes a 20 second timeout. If it's showing "retry" before then, it's because of a different problem.

billba avatar May 24 '17 13:05 billba

@alokraj68 I don't quite understand your scenario but it sounds like a different bug. Please open a new issue for it.

billba avatar May 24 '17 13:05 billba

I am also facing the same issue, the bot responds with "couldn't send retry" but actually the conversation proceeds. How can i fix this?

akasranjan005 avatar Jun 27 '17 09:06 akasranjan005

We fixed this by immediately returning from the message controller with HttpOK. And start the bot in a async void background thread.

From: Akash Ranjan Sent: Tuesday, June 27, 2017 2:30 AM To: Microsoft/BotFramework-WebChat Cc: ohmusama; Comment Subject: Re: [Microsoft/BotFramework-WebChat] Web chat shows retry but messageis really send to bot (#465)

I am also facing the same issue, the bot responds with "couldn't send retry" but actually the conversation proceeds. How can i fix this? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

ohmusama avatar Jun 27 '17 14:06 ohmusama

I would still like to know more about this problem. WebChat/DirectLineJS has a 20 second timeout. Are you all seeing faster fails than that? If so it's (probably) not on the client side. In your response please say which SDK you are using (.net or node).

billba avatar Jun 27 '17 16:06 billba

In telemetry we were seeing intermittent 15s timeouts, but it appeared to the client faster on occasion. We assumed it was our fault.

From: Bill Barnes Sent: Tuesday, June 27, 2017 9:04 AM To: Microsoft/BotFramework-WebChat Cc: ohmusama; Comment Subject: Re: [Microsoft/BotFramework-WebChat] Web chat shows retry but messageis really send to bot (#465)

I would still like to know more about this problem. WebChat/DirectLineJS has a 20 second timeout. Are you all seeing faster fails than that? If so it's (probably) not on the client side. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

ohmusama avatar Jun 27 '17 16:06 ohmusama

Hi guys, Am also receiving a similar error in telemetry. am using .net SDK. This error started to creep in recently. we are not able to identify what causes this error.

alokraj68 avatar Jun 28 '17 07:06 alokraj68

I am using rest api on python, maybe the case is of timeout but how can i handle it if the processing work takes more than 20 sec?

akasranjan005 avatar Jun 28 '17 07:06 akasranjan005

but in our case, the processing is not taking that long when we do the testing,

alokraj68 avatar Jun 28 '17 07:06 alokraj68

I'm having the same issue with the built in iframe. Facing two errors:

  • Couldnt send
  • My bot code is having issues

frnk01 avatar Sep 26 '17 08:09 frnk01

Hello everyone, here's a couple of tips for these kinds of errors.

  • Make sure you log all errors in your bot. If your bot returns an HTTP 500, Direct Line will then pass that as a 502, which will appear as a failure to Web Chat. You will need to know why your bot had the 500 error.
  • If you are using the .NET SDK, and you are logging errors, and your error is "Authorization for Microsoft App ID failed with status code Forbidden", then you may need to add a call to MicrosoftAppCredentials.TrustServiceUrl(serviceUrl) - see BotBuilder solutions for similar issues.

danmarshall avatar Sep 26 '17 18:09 danmarshall

Hello every once i am working on microsoft bot, direct line, and deployed on my personal server on IIS, If i test it threw emulator it is working fine, but if i test it threw I Frame in my website it si giving me 502 Bad Gateway error

POST https://webchat.botframework.com/v3/directline/conversations/HyZVX4cBPGh115QwKfStKj/activities 502 (Bad Gateway)

this is in channel page: There was an error sending this message to your bot: HTTP status code InternalServerError

ashish-harsora avatar Mar 26 '18 12:03 ashish-harsora

Is there ways to customize when the retry message comes up? Some OCR processes take more time than the default 20 seconds.

andrewchungxam avatar Aug 29 '18 22:08 andrewchungxam

Investigate if fixed in v4. If not, mark as P3 or P4 for 4.4

corinagum avatar Nov 28 '18 01:11 corinagum

@andrewchungxam if there are any server-side processing that would take > 5 seconds, I would suggest replying with a typing activity every ~3 seconds while it is processing. On Web Chat side, the user will see "dot-dot-dot" animation and they will know something is going on. And since the bot replied, Web Chat will not receive 502 due to gateway timeout.

For the processing, it can be queued to a service bus and you can use proactive messaging to report the status back to the user.

compulim avatar Dec 18 '18 20:12 compulim

@billba I am facing similar issue. The bot sends "couldn't send retry" at starting of chat and on clicking retry it sends the message works normally. I am facing issue in test in webchat and directline chat. Every time the user needs to click on retry to start conversation.

vinayak99999 avatar Dec 27 '18 07:12 vinayak99999

Why is this happening? Is @compulim 's suggestion the only current known workaround? Can someone facing the same problem report back on what you've done so far to get this fixed?

raghukrishnamoorthy avatar Feb 11 '19 06:02 raghukrishnamoorthy