Open
Description
Version
I am using the following packages
botbuilder-schema==4.13.0
botbuilder-core==4.13.0
botbuilder-dialogs==4.13.0
Describe the bug
ShowTypingMiddleware goes into an infinite loop of sending typing activity to user when on_error() method of the BotFrameworkAdapter is called. It doesn't stop till the application is restarted. This is easily reproduced in BotBuilder-Samples tested with BotFramework Emulator.
To Reproduce
Steps to reproduce the behavior:
- add
ADAPTER.use(ShowTypingMiddleware(delay=0.5, period=1.0))
to app.py of 13, Core Bot Python Sample - Write some code that takes calls the adapter's on_error() method i.e.
print(ThisIsABug)
in destination step in dialogs/booking_dialog.py - Start the app and test the dialog from BotFramework Emulator.
- The app sends infinite typing activity to the emulator when the error is encountered in code.
Expected behavior
ShowTypingMiddleware should stop sending typing activity if on_error() method is called.
Screenshots
Additional context
NA
Metadata
Metadata
Assignees
Labels
Required for internal Azure reporting. Do not delete. Do not change color.Use this label to exclude the issue from the DRI report.Indicates an unexpected problem or an unintended behavior.Indicates that the team has replied to the issue reported by the customer. Do not delete.Issue is created by anyone that is not a collaborator in the repository.
Activity
stevkan commentedon Nov 1, 2022
@Kevv-J,
The delay and period properties take values expressed in milliseconds. So, for example, if you are wanting the delay to be half a second, then you would want to pass in
delay=500
. As you have it, the delay is set to half a millisecond and the period to one millisecond which likely is contributing to your issue.Try adjusting those values, test again, and let me know if the issue persists.
Kevv-J commentedon Nov 2, 2022
Hi @stevkan,
Thanks for the quick reply. The documentation states that the delay and period properties take values in seconds as mentioned here, I had just used the default values of the function.
Just in case the documentation is incorrect I tried your suggestion with 500 as delay and 1000 as period and the typing activity was not sent even after 30 seconds of inactivity. tested by adding an
await asyncio.sleep(30)
inside the dialog.Am I doing something wrong?
stevkan commentedon Nov 3, 2022
@Kevv-J,
Apologies for the confusion there. I had just looked over that bit of code but failed to notice it specifies seconds (vs milliseconds which is used in the other three SDKs). While it really shouldn't matter, it also shouldn't be necessary to name the properties when passing in the values to the middleware. Can you try
ShowTypingMiddleware(0.5, 1.0)
and see if that makes any difference.In the meantime, I will work on repro'ing this and will get back to you with my results.
Kevv-J commentedon Nov 9, 2022
Hi @stevkan
No luck with
ShowTypingMiddleware(0.5, 1.0)
I'm getting the same infinite typing activities bug when it goes into on_error().Were you able to reproduce this on your end?
anishprasad01 commentedon Nov 11, 2022
@Kevv-J,
We were able to reproduce this. Currently investigating further.
13 remaining items