4.6.2
Typing indicator is showing after a message has been sent by the bot and typing indicator will timeout depending on the front-end channel that is used. This only happens if you do more work in the Turn then just sending out a single message like in the examples. In our current implementations we also save data to the database, execute some external processes and they all need to finish before the Cancellation is actually called on the ShowTypingMiddleware.
Repro repo: https://github.com/jvanderbiest/echo-bot-typing-indicator
Steps to reproduce the behavior:
ShowTypingMiddleware and CustomShowTypingMiddlewareThe EchoBot simulates some extra work after sending the initial message
Code snippet:
protected override async Task OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken)
{
var activity = await CreateActivityWithTextAndSpeak($"Echo: {turnContext.Activity.Text}");
await RunSomething();
await turnContext.SendActivityAsync(activity, cancellationToken);
await RunSomething();
}
private async Task RunSomething()
{
await Task.Delay(5000);
}
As a temporary fix, I check if the bot has already responded:
https://github.com/jvanderbiest/echo-bot-typing-indicator/blob/master/CustomShowTypingMiddleware.cs#L90
Sending a bot message should stop the typing indicator and it should not send out any typing indicator activities
How it currently works

How it should work

Any workaround or suggestion is appreciated
[bug]
Facing same issue here, your CustomShowTypingMiddleware seems to solve that!
@jvanderbiest Is this consistent across channels other than emulator?
@dmvtech This was happening for me on Facebook and Direct Line (webchat), that workaround solved it for both channels
Hi @jvanderbiest, we think this issue is solved. Closing it.
I wasn't able to reproduce just now, so seems so from my end.
@dvmtech I will check if it works with the latest master version
I could even reproduce the issue with v4.7.0-preview-191203-1 from myget.
So it's still there...
@dmvtech my repo reproduced the issue, just use the normal ShowTypingMiddleware by commenting out the CustomShowTypingMiddleware as I described in the repro steps. It happens at least on these channels: emulator, webchat, facebook. Did not try other channels but I guess it has the same issue as it sends out the TypingActivity afterwards.
https://github.com/jvanderbiest/echo-bot-typing-indicator/blob/master/AdapterWithErrorHandler.cs#L18
Ok, i'll try again. I just used your repro from your repo, but am using 4.6.3.
I am able to reproduce this now (not sure what I was doing before 馃槓). I can repro on both 4.6.2 and 4.6.3.
@dmvtech Does this repro on 4.7?
I will check
@a-b-r-o-w-n Confirmation reproduces in 4.7.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days