-
Notifications
You must be signed in to change notification settings - Fork 2.3k
bot.beginDialog causes unexpected message if dialog already open #1878
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
[not stale, looks like others have experienced as well] |
I FINALLY FIGURED THIS OUT! |
This had to do with the fact that, inside the handler, the active dialog was changing. AFTER the handler is run, it attempts to continue on to the next step. Since the dialog had changed, it resumed improperly. Still some work to do to validate but I think this will be addressed soon. |
OK! This is going to be addressed in the next release. HOWEVER, there is a follow up bug that I discovered while fixing this. Calling beginDialog from an |
Issue
Using
bot.beginDialog
orbot.replaceDialog
when there's already a dialog open (e.g. to switch to the new dialog based on user input) causes the bot to automatically receive an unexpected{}
message.This message breaks questions, because the empty message is interpreted by botkit as an answer to the question, and the user doesn't have a chance to give input.
Demo
I made a simple working demo app here that you can clone to see the issue.
hi
to trigger ONBOARDING_DIALOGyes
to confirm and trigger ONBOARDING_DIALOG_2{}
as a response without your input. It's impossible to reply with your name.Workaround
See this commit for a successful workaround using
dialog.addGotoDialog
instead ofbot.beginDialog
.It's great that this works, but it isn't possible to use this in all cases (e.g. this issue).
Context
The text was updated successfully, but these errors were encountered: