-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ShowTypingMiddleware - Infinite loop of typing activity when Adapter on_error() method is called. #1980
Comments
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 Try adjusting those values, test again, and let me know if the issue persists. |
Hi @stevkan, 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 Am I doing something wrong? |
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 In the meantime, I will work on repro'ing this and will get back to you with my results. |
Hi @stevkan No luck with |
We were able to reproduce this. Currently investigating further. |
Hi @anishprasad01, I have come up with a make-shift solution, can you confirm if this would work. botbuilder.core.ShowTypingMiddlewareIn on_turn() methodI have changed all 13.core-bot/botsin on_error() method of BotConfigI have added the following code block
This seems to be working as expected for now, but do you see any issues in doing things this way. Is there a better way to do this? Thanks in advance |
Is there any progress on this? I am very interested as facing the same issue |
Apologies for the delay. We're still planning on addressing this, it hasn't been forgotten. |
I explored modifying this behavior within the SDK by adding some sort of timeout or auto-cancel of the middleware task, but after some thought, I'm afraid that doing so will break bots with long-running operations that use typing middleware. Stopping the middleware within the SDK would require a bot developer to know exactly how long each operation will take, and that is simply not possible. Given this, your approach of fixing it within the bot itself would seem to be the best way to accomplish it. I will be looking for an alternative solution just in case, but if it's working for you, then great! |
It seems like your workaround to create a modified middleware is probably the most appropriate solution for the moment, as an SDK fix would likely require a breaking change (as discussed in my previous post). Thank you again for reporting this issue. An SDK fix will remain under consideration. |
I had similar issue with typing indicator stuck in infinite loop when an error occurred. I made the following changes to stop typing indicator.
|
Version
I am using the following packages
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:
ADAPTER.use(ShowTypingMiddleware(delay=0.5, period=1.0))
to app.py of 13, Core Bot Python Sampleprint(ThisIsABug)
in destination step in dialogs/booking_dialog.pyExpected behavior
ShowTypingMiddleware should stop sending typing activity if on_error() method is called.
Screenshots
Additional context
NA
The text was updated successfully, but these errors were encountered: