2
votes

Occasionally the bot sends a timeout error. It seems that it happens by requests with larger amout of data. Is it possible to increase the timeout or cash buffer?

Request

https://directline.botframework.com/v3/directline/conversations/xxx/activities

Response

{
  "error": {
    "code": "BotError",
    "message": "Failed to send activity: bot timed out"
  },
  "httpStatusCode": 504
}

Payload

17. x-ms-bot-agent: 
DirectLine/3.0 (directlinejs; WebChat/4.9.0 (Full))
18. x-requested-with: 
XMLHttpRequest
4.  Request Payloadview source
1.  {,…}
1.  channelData: {clientActivityID: "", clientTimestamp: "2020-06-05T06:57:43.001Z"}
2.  channelId: "webchat"
3.  from: {id: "",…}
4.  locale: "en-US"
5.  text: "nohy"
6.  textFormat: "plain"
7.  timestamp: "2020-06-05T06:57:43.045Z"
8.  type: "message"

Any idea guys?

1

1 Answers

2
votes

You cannot increase the timeout limit. This is a limit imposed by the Direct Line service, and is set in place for performance and stability reasons. The timeout happens because your bot/code takes too long to respond back to the service, not because of how much data (unless that large data is contributing to the length of time to reply).

You should investigate your bot and those portions of it that take longer, to see if you can decrease the time taken. If you know that there are areas (say external calls to other services, etc) that will take a long time and is unavoidable; then you should implement proactive messaging to remedy that.