botframework-components icon indicating copy to clipboard operation
botframework-components copied to clipboard

Microsoft.Bot.Components.AdaptiveCards - OnDataQuery trigger doesn't work as expected

Open GennadyM73 opened this issue 3 years ago • 6 comments

Describe the bug

OnDataQuery trigger from Microsoft.Bot.Components.AdaptiveCards package doesn't start when Data.Query activity received from adaptive card.

Version

Tested on 1.3.0, 1.4.0 Composer version - 2.1.2

To Reproduce

  1. Send adaptive card containing Input.ChoiceSet with dynamic typeahead search to user as described in this example: https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/dynamic-search?tabs=mobile%2Cjson#example

  2. On user side start typing something in 'Multi-Game' field. As a result 'Data.Query' activity will be sent to the bot.

Expected behavior

The trigger should start when Data.Query activity received from adaptive card.

Additional context

I think the issue is related to https://github.com/microsoft/botframework-components/blob/main/packages/AdaptiveCards/Triggers/OnDataQuery.cs

line 64: Expression.Parse($"{TurnPath.Activity}.name == 'adaptiveCard/action'"),

The activity which bot receives from adaptive card contains different name : "value": { "queryText": "test", "queryOptions": { "skip": 0, "top": 15 }, "dataset": "xbox" }, "name": "application/search",

GennadyM73 avatar Oct 18 '22 22:10 GennadyM73

Thank you @GennadyM73, we are investigating.

ram-xv avatar Oct 21 '22 00:10 ram-xv

Hi @GennadyM73,

I'm able to reproduce this issue. After typing in Multi-game input field, it appears the OnDataQuery is not triggered.

Sharing the steps to repro this issue:

  1. Create a Composer Bot

  2. Add Microsoft App Id and App Password to the composer bot in "Development Resources" settings

  3. In Composer, install package Microsoft.Bot.Components.AdaptiveCards

  4. In Unknown intent, click + icon and select "Adaptive Cards -> Send an Adaptive Card"

  5. In Template property, copy and paste the following dynamic typeahead search adaptive card

  6. Run the bot in Teams Channel. Used ngrok tunnelling solution.

  7. Chat with the bot in Teams and trigger the unknown intent to display the adaptive card

  8. In Multi-Game input field, start typing

  9. Notice error message in ngrok terminal 501 Not Implemented image

/api/messages POST request

{
    "name": "application/search",
    "type": "invoke",
    "timestamp": "2022-10-25T07:11:43.887Z",
    "localTimestamp": "2022-10-25T00:11:43.887-07:00",
    "channelId": "msteams",
    "serviceUrl": "https://smba.trafficmanager.net/amer/",
    "from": {
        "name": "Ram Fattah",
    },
    "conversation": {
        "conversationType": "personal",
    },
    "value": {
        "queryText": "st",
        "queryOptions": {
            "skip": 0,
            "top": 15
        },
        "dataset": "xbox"
    },
    "locale": "en-US",
    "localTimezone": "America/Los_Angeles"
}

ram-xv avatar Oct 25 '22 16:10 ram-xv

We are discussing internally for the next steps. Thanks for your patience @GennadyM73.

ram-xv avatar Oct 26 '22 01:10 ram-xv

Hey @JuanAr, we are able to reproduce this issue.

I shared the steps to repro in above discussion, please let me know if you have any questions. Thanks

ram-xv avatar Oct 26 '22 16:10 ram-xv

Hi @ramfattah! Do you want to assign me the issue and we'll add it to our backlog and tackle it next week.

Thanks!

JuanAr avatar Oct 26 '22 20:10 JuanAr

Thanks @JuanAr.

ram-xv avatar Oct 26 '22 20:10 ram-xv