I'm using the code below to send a "Typing..." indicator to the user while my bot is doing some processing. This is sent the first thing on any message before any dialog is deserialized and launched.
The problem is the indicator does not disappear, even after 6 seconds as it should, according to facebook.
So after the bot sends its messages, the Typing... indicator still remains there forever.
This only happens on FB Messenger but not with other channels like Telegram or emulator.
if (activity.Type == ActivityTypes.Message)
{
Activity typing = activity.CreateReply(null);
typing.ServiceUrl = activity.ServiceUrl; //bug in ms bot framework? otherwise service URL is null
typing.Type = ActivityTypes.Typing;
ConnectorClient connector = new ConnectorClient(new Uri(typing.ServiceUrl));
await connector.Conversations.SendToConversationAsync(typing);
//do the actual bot's work here
Per Facebook, it turns out their actual timeout for the typing message is 20s:
https://developers.facebook.com/docs/messenger-platform/send-api-reference/sender-actions
Additionally when the bot responds with an actual message the Typing indicator will be removed.
I verified this behavior with my test bot. Bot framework does not send the "end typing" message, only the begin typing one.