Botframework-solutions: Virtual Assistant Dialog is not getting closed even after Skill dialog is closed

Created on 8 Mar 2021  路  7Comments  路  Source: microsoft/botframework-solutions

What project is affected?

Virtual Assistant & Skill

"botbuilder": "^4.11.0",
"botbuilder-ai": "^4.11.0",
"botbuilder-applicationinsights": "^4.11.0",
"botbuilder-azure": "^4.11.0",
"botbuilder-dialogs": "^4.11.0",
"botbuilder-lg": "^4.11.0",

What language is this in?

Typescript

What happens?

We have Virtual assistant and Skill projects. We have dialogs in skill and ability to connect to skill and do all the actions but once the dialog is closed at skill side, and give the utterance in the bot, in VA the new utterance is not going from the first step instead flow is starting from onContinueDialog and connecting to Skill.

On the skill side, once the dialog is completed the finalStep in MainDialog is calling, below is the function

private async finalStep(stepContext: WaterfallStepContext): Promise<DialogTurnResult> {
        console.log('skill finalStep');
        if (TurnContextEx.isSkill(stepContext.context)) {
            const result = stepContext.result;

            return await stepContext.endDialog(result);
        } else {
            return await stepContext.endDialog();
        }
    }

What are the steps to reproduce this issue?

Create VA: https://microsoft.github.io/botframework-solutions/virtual-assistant/tutorials/create-assistant/typescript/3-create-project/
Create Skill: https://microsoft.github.io/botframework-solutions/skills/tutorials/create-skill/typescript/3-create-your-skill/

What were you expecting to happen?

The new utterance should start from the first step in VA after the dialog is closed in Skill.

Thanks,
Sreekanth (Ecolab)

Bot Services Needs Triage Kobuk Bug customer-replied-to customer-reported

All 7 comments

Adding to the ticket,

But, when I update the finalStep just before ending the dialog in the Skill MainDialog.ts file, the Virtual Assistant dialog also getting closed.

const EoCResponse: Activity = ActivityEx.createReply(stepContext.context.activity);
 EoCResponse.type = ActivityTypes.EndOfConversation;
 await stepContext.context.sendActivity(EoCResponse);

Please confirm these statements. If these are ok, I'll go ahead and use them.

Thanks,
Sreekanth

Thanks @SreekanthOAuth for reporting this issue, we will start working on this issue the next week. We will communicate all the updates here 馃槉.

Hi @SreekanthOAuth, sorry for the delay. This week we will start working on this issue, we will let you know any update here 馃槉.

Hi @SreekanthOAuth, we want to confirm with you that we understood the issue.

We have a few questions:

  1. What you are saying is that after completing the skill's dialog, when the skill's dialog utterance is sent again to the assistant, instead of starting the assistant's waterfall steps again it is sent through the onContinueDialog. Is the scenario we described correct?
  2. Do you expect the assistant's waterfall dialog to start over when the skill's dialog is completed?
  3. Does your snippet make the assistant's waterfall start over after the skill's dialog is completed?

We believe that this is by design. @lauren-mills, @darrenj could you please confirm this?

@VictorGrycuk - Please find the answers for each question

We have a few questions:

What you are saying is that after completing the skill's dialog, when the skill's dialog utterance is sent again to the assistant, instead of starting the assistant's waterfall steps again it is sent through the onContinueDialog. Is the scenario we described correct? - _[When the skill dialog is closed and the user is given a new utterance it should start the waterfall steps from the first step in VA]_
Do you expect the assistant's waterfall dialog to start over when the skill's dialog is completed? _[Yes]_
Does your snippet make the assistant's waterfall start over after the skill's dialog is completed? _[Yes]_

Thank you @SreekanthOAuth. We were able to reproduce the behaviour you describe, and we think it is by design. As you can see here, the onContinueDialog will always be executed at the start of a turn unless it's the first time that the dialog is run.

By applying this modification you are ending the current Sample Virtual Assistant dialog, so when the skill utterance is sent a second time, after both dialogs were ended, it will be onBeginDialog that is executed instead of onContinueDialog.

These were our repro steps:

  1. Deploy a Sample Virtual Assistant and Sample Skill
  2. Connect the Skill to the Virtual Assistant
  3. Update the Skill mainDialog's finalStep as you described here.
  4. Start both samples
  5. Start a conversation with the Virtual Assistant using the BotFramework Emulator
  6. Complete the onboarding dialog
  7. Send run sample dialog
  8. Complete Skill's dialog
  9. Set a breakpoint in onContinueDialog and onBoardingStep
  10. Send run sample dialog again
  11. The breakpoint that is activated is onContinueDialog, before starting the skill. The breakpoint at onBoardingStep will not be activated.

Closing given the response above, but feel free to reactivate if you have further questions or issues with the sample

Was this page helpful?
0 / 5 - 0 ratings