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
I have a problem on a project i’m working on at the moment, for security reasons I cannot share detailed information, but it’s a marketing chatbot.
Our project is currently on the SDK 3.1, and we’re having a problem where the last input from the user is triggering events, even though it was already processed earlier.
User says hello and starts the conversation
The bot asks for some information to login/register the user
The user enters said information and proceeds down the flow
The bot asks some extra information
The user enters their answer for that
The bot continues and processes the user input again
After finishing the login/register process, regardless if the user left the conversation hanging for a bit or continued the flow, the bot uses the information from the last step as an input for the current flow. Let’s say the question on step 4 was answered with an YES, and now the user was given a list of options to select, but somehow OnTurnAsync/OnMessageActivityAsync gets triggered and tries to use the YES from the previous question and continue the flow with that, and this can happen in parallel with the user actual answer, so it will have 2 difference messages processed at the same time.
The dialog flow we have is like this:
RootDialog -> BeginDialogAsync(MainDialog) -> BeginDialogAsync(RegistrationDialog) -> BeginDialogAsync(EmailDialog) -> BeginDialogAsync(TextPrompt) -> EndDialogAsync(TextPrompt) -> BeginDialogAsync(LoginValidationDialog) -> BeginDialogAsync(TextPrompt) -> EndDialogAsync(TextPrompt) -> BeginDialogAsync(TextPrompt) -> EndDialogAsync(TextPrompt) -> EndDialogAsync(LoginValidationDialog) -> EndDialogAsync(EmailDialog) -> BeginDialogAsync(UpdateUserDialog) -> EndDialogAsync(UpdateUserDialog) -> BeginDialogAsync(SignInUserDialog) -> EndDialogAsync(SignInUserDialog) -> BeginDialogAsync(LoggedInDialog) …
There are some APIs called in the background at some points in the flow and depending on the results, the user might be asked other questions or not, this example is the “happy” flow.
So far all that was tested and found was:
This issue so far does not happen at all on the emulator, only on WhatsApp.
This is not exclusive to a specific flow/set of dialogs, it can happen basically at any point
This is an intermittent issue, does not happen 100% of the time
Our dialogs only references and adds to the Dialog Set the Dialog classes that it can call directly. Ex.: RootDialog has AddDialog(MainDialog) and AddDialog(new WaterfallSteps[]), MainDialog has AddDialog(FirstDialog) and AddDialog(new WaterfallSteps[]) and so on...
All Dialog classes have the InitialDialogId set as their own name
OnMessageActivityAsync override there’s only a logger call and an await dialog.RunAsync(turnContext, _conversationState.CreateProperty(nameof(DialogState)), cancellationToken)
dialog is of type T : Dialog
OnTurnAsync override has a few more steps, but it’s simple as well:
Tried changing BeginDialogAsync for ReplaceDialogAsync
Managed to reproduce locally by creating a tunnel from WhatsApp to the project, but after a few iterations I stopped getting the bug
Tried adding a Load and Save for the conversation and user state in the ActivityHandler, both on OnMessageActivityAsync and OnTurnAsync
During the small time I actually was able to debug I saw that the Message Activity was being passed down and went from Responded True to Responded False;
The text was updated successfully, but these errors were encountered:
Hi all
I have a problem on a project i’m working on at the moment, for security reasons I cannot share detailed information, but it’s a marketing chatbot.
Our project is currently on the SDK 3.1, and we’re having a problem where the last input from the user is triggering events, even though it was already processed earlier.
The dialog flow we have is like this:
RootDialog -> BeginDialogAsync(MainDialog) -> BeginDialogAsync(RegistrationDialog) -> BeginDialogAsync(EmailDialog) -> BeginDialogAsync(TextPrompt) -> EndDialogAsync(TextPrompt) -> BeginDialogAsync(LoginValidationDialog) -> BeginDialogAsync(TextPrompt) -> EndDialogAsync(TextPrompt) -> BeginDialogAsync(TextPrompt) -> EndDialogAsync(TextPrompt) -> EndDialogAsync(LoginValidationDialog) -> EndDialogAsync(EmailDialog) -> BeginDialogAsync(UpdateUserDialog) -> EndDialogAsync(UpdateUserDialog) -> BeginDialogAsync(SignInUserDialog) -> EndDialogAsync(SignInUserDialog) -> BeginDialogAsync(LoggedInDialog) …
There are some APIs called in the background at some points in the flow and depending on the results, the user might be asked other questions or not, this example is the “happy” flow.
So far all that was tested and found was:
The text was updated successfully, but these errors were encountered: