You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Emulator sends a request to the bot, it waits for an HTTP response before it updates the UI with all the messages the bot sent to the Emulator
To Reproduce
Run a bot that sends multiple messages in one turn with a delay between them
Connect to the bot in Emulator
Observe that the messages are all displayed at the same time
Here is some Python code that can reproduce the problem. Note that the problem is not Python-specific, and can be reproduced with any language.
asyncdefon_message_activity(self, turn_context: TurnContext):
start=time.time()
elapsed=time.time() -startprint(f"Message received after {elapsed:.1f} seconds")
awaitturn_context.send_activity(f"Message received after {elapsed:.1f} seconds")
awaitasyncio.sleep(2)
elapsed=time.time() -startprint(f"Finished after {elapsed:.1f} seconds!")
awaitturn_context.send_activity(f"Finished after {elapsed:.1f} seconds!")
Expected behavior
Emulator should display messages immediately as it receives them, the same as any channel.
Screenshots
This is the problem in Emulator:
Here you can see that the print statements are displayed at the right time while the send_activity statements aren't:
This is the correct behavior in Web Chat (which can be seen in any other channel as well):
Version
4.12.0
Describe the bug
When Emulator sends a request to the bot, it waits for an HTTP response before it updates the UI with all the messages the bot sent to the Emulator
To Reproduce
Here is some Python code that can reproduce the problem. Note that the problem is not Python-specific, and can be reproduced with any language.
Expected behavior
Emulator should display messages immediately as it receives them, the same as any channel.
Screenshots
This is the problem in Emulator:
Here you can see that the print statements are displayed at the right time while the
send_activity
statements aren't:This is the correct behavior in Web Chat (which can be seen in any other channel as well):
Additional context
Related Stack Overflow thread: https://stackoverflow.com/questions/67172737/botbuilder-display-message-while-waiting-for-blocking-function
[bug]
The text was updated successfully, but these errors were encountered: