node.jsazure-bot-servicecortana-skills-kit

Can't send any other activity after sending adaptive card


My adaptive card sends, and it continues to the next step in the dialogue (printed something to make sure) But for some reason it won't display any other activity, whether it be a prompt, another adaptive card, or just text. I've tried having them in the same async step and sending one after the other but that doesn't work either. I'm not getting any error messages, and everything else in the step will execute besides anything 'sendActivity' methods Is there some sort of convention I'm unaware of?

I've narrowed down the issue to the Cortana channel, as it works perfectly in both the web chat and emulator

class BookingDialog extends CancelAndHelpDialog {
    constructor(id) {
        super(id || 'bookingDialog');

    this.addDialog(new TextPrompt(TEXT_PROMPT))
        .addDialog(new ConfirmPrompt(CONFIRM_PROMPT))
        .addDialog(new DateResolverDialog(DATE_RESOLVER_DIALOG))
        .addDialog(new WaterfallDialog(WATERFALL_DIALOG, [
            this.destinationStep.bind(this),
            this.originStep.bind(this),
            this.travelDateStep.bind(this),
            this.confirmStep.bind(this),
            this.finalStep.bind(this)
        ]));

    this.initialDialogId = WATERFALL_DIALOG;
}

/**
 * If a destination city has not been provided, prompt for one.
 */
async destinationStep(stepContext) {
    console.log("DESTINATION");
    var Card = CardFactory.adaptiveCard(WelcomeCard);
    const bookingDetails = stepContext.options;

    await stepContext.context.sendActivity({ attachments: [Card],attachmentLayout: AttachmentLayoutTypes.Carousel});
        return await stepContext.next(bookingDetails);

}

/**
 * If an origin city has not been provided, prompt for one.
 */
async originStep(stepContext) {

   return await stepContext.context.sendActivity("Would you like to email them?");
}

Solution

  • If you are using Cortana, don't forget to add the inputHint. Also, what device are you testing Cortana on? Sounds to me like the channel is closed, so what happens on the next turn in Cortana? If you don't send the adaptive card, does it still act up? If there is a syntax error in the card, I believe Cortana will quit. Post the card json. Check all required fields are there, and that all types are expected.