I have an Azure Bot deployed and running on Directline channel on web page. The bot works well but leaving the bot a few mins idle, results in an error with the message "Unable to connect". I need to refresh the page to restart the bot. How can I avoid this timeout?
Asked
Active
Viewed 382 times
1 Answers
2
As the documentation states, Direct Line connections persist for a set amount of time until they timeout. Once the connection has closed, you will need to reconnect to the conversation to regain connection with the bot. Refreshing the page has a similar effect in that you are establishing a new connection with the bot.

AP01
- 820
- 1
- 2
- 8
-
Thanks for the info. Is there an event when timeout occurs so I can attempt to make a reconnect? – sachin Jan 27 '22 at 13:47
-
I don't believe there is a specific event sent proactively by the channel, but your attempt to use a timed-out connection will fail. You should therefore be able to use the information contained in the API's response to determine when you need to perform a reconnection. – AP01 Jan 28 '22 at 17:31