botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Sending multiple requests when the bot is running

Open irynabond opened this issue 10 years ago • 5 comments

Hello, My bot is using a Web Chat channel and hosted on azurewebsites.net. When I open the webpage and Fiddler I see that this webpage makes thousands requests. Here is a fiddler screenshot: botrequests

Why is it happening? Is it possible to fix? Thank you!

irynabond avatar Aug 31 '16 01:08 irynabond

MS can confirm it, but your bot is polling for new messages.

In my opinion, it's a pity that directline –and apparently other channels– doesn't come with some kind of push mechanism. In some scenarios (ex. mobile app) it could be a blocking issue (ex. battery drain). I don't know if there is a recommended way to solve this issue.

palmerabollo avatar Aug 31 '16 08:08 palmerabollo

@palmerabollo As you mentioned, this is true for clients using the Direct Line API, like Web Chat or mobile apps. Not true, however, for other channels, as they use the Bot Connector API which does not store messages. (Just clarifying your remark regarding other channels.)

Thegaram avatar Aug 31 '16 16:08 Thegaram

Thanks for your replies! I don't use the Direct Line API . Now it's a simple url wrapped in iframe generated by web chat channel and embedded into html code. I am going to develop my own UI and to use the Direct Line API. Is there a chance that it will solve this problem? This is a CaptionBot developed by Microsoft . When I open Fiddler there are no multiple requests from this page.

irynabond avatar Aug 31 '16 17:08 irynabond

Webchat is using Direct line API which uses a polling mechanism to fetch messages from bot.

msft-shahins avatar Aug 31 '16 23:08 msft-shahins

Thank you, now I understand why it's happening.

irynabond avatar Aug 31 '16 23:08 irynabond