botbuilder-dotnet icon indicating copy to clipboard operation
botbuilder-dotnet copied to clipboard

Parameter MessagingExtensionQuery always returns just first CommandId from manifest

Open harald-thoenig opened this issue 3 years ago • 12 comments

I'm using Microsoft Bot Framework V4 SDK to create a messaging extension bot.

I created two commands (searchQuery, processQuery). I would like to call up a configuration page for each command. The problem is that the MessagingExtensionQuery parameter in the OnTeamsMessagingExtensionConfigurationQuerySettingUrlAsync event always returns just the first command Id, I entered in the manifest.

I would have expected that when I click on the 3 dots to open the configuration page, the respective ID of the command would be passed to the event.

Messaging extension bot ConfigurationPage Manifest

Hope you can help. regads

harald-thoenig avatar Sep 05 '22 15:09 harald-thoenig

I am taking a look at this.

dmvtech avatar Sep 07 '22 17:09 dmvtech

@dmvtech any update on this?

DridiFathi avatar Sep 15 '22 09:09 DridiFathi

Hi @harald-thoenig @DridiFathi

Apologies for the delay. We are still investigating.

dmvtech avatar Sep 20 '22 17:09 dmvtech

Hi @harald-thoenig

To clarify the behavior a bit. When you say:

when I click on the 3 dots to open the configuration page

Do you mean; when you click on the three dots? Or when you select settings: image

If you could please share more information and specifics on how exactly you set up the configuration/configuration page.

dmvtech avatar Sep 29 '22 18:09 dmvtech

@ramfattah

dmvtech avatar Sep 29 '22 18:09 dmvtech

Hi @ramfattah If I select settings the event OnTeamsMessagingExtensionConfigurationQuerySettingUrlAsync will be triggered. In this event I get the command Id. But this command Id is always the first command Id from manifest. But I like to know on which command the user has selected the settings, then I could provide users different configuration pages per command Id. I did the implementation of the configuration page exactly as it is described in the git sample "https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore/50.teams-messaging-extensions-search/Bots)".

harald-thoenig avatar Sep 30 '22 06:09 harald-thoenig

Thanks @harald-thoenig,

I was able to reproduce this issue using C# bot sample 52.teams-messaging-extensions-search-auth-config.

Sharing the steps to reproduce:

  1. Clone sample 52.teams-messaging-extensions-search-auth-config into your local environment.
  2. In file manifest.json, replace the commands section with the following:
    
     "name": {
       "short": "Messaging Extension Auth",
       "full": "ME Auth for Search, Action and link unfurling"
     },
     "description": {
       "short": "ME Authentication for Search, Action and Link unfurling",
       "full": "ME Authentication sample code for all authentication merged"
     },
     "accentColor": "#FFFFFF",
     "composeExtensions": [
       {
         "botId": "<<YOUR-MICROSOFT-APP-ID>>",
         "canUpdateConfiguration": true,
    +      "commands": [
    +        {
    +          "id": "searchQuery",
    +         "type": "query",
    +          "title": "Search",
    +          "description": "Perform a search",
    +          "initialRun": false,
    +          "fetchTask": false,
    +          "context": [
    +            "commandBox",
    +            "compose",
    +            "message"
    +          ],
    +          "parameters": [
    +            {
    +              "name": "searchQuery",
    +              "title": "Search",
    +              "description": "Your search query",
    +              "inputType": "text"
    +            }
    +          ]
    +        },
    +        {
    +          "id": "processQuery",
    +          "type": "query",
    +          "title": "Tasks",
    +          "description": "Task lists",
    +          "initialRun": true,
    +          "fetchTask": false,
    +          "context": [
    +           "commandBox",
    +            "compose",
    +            "message"
    +          ],
    +          "parameters": [
    +            {
    +              "name": "processQuery",
    +              "title": "Process",
    +              "description": "ProcessList",
    +              "inputType": "text"
    +            }
    +          ]
    +        },
    +        {
    +          "id": "SignOutCommand",
    +          "type": "action",
    +          "title": "Sign Out",
    +          "description": "Sign out from authenticated services.",
    +          "initialRun": false,
    +          "fetchTask": true,
    +          "context": [
    +            "commandBox",
    +            "compose"
    +          ],
    +          "parameters": [
    +            {
    +              "name": "param",
    +              "title": "param",
    +              "description": ""
    +            }
    +          ]
    +        }
    +      ],
         "messageHandlers": [
           {
             "type": "link",
             "value": {
               "domains": [
                 "*.botframework.com"
               ]
             }
           }
         ]
       }
     ],
     "permissions": [
       "identity"
     ],
     "validDomains": [
       "*.githubusercontent.com",
       "*.ngrok.io",
       "*.botframework.com"
     ]
    }
    
    
    • Notice we have 3 command ids: searchQuery, processQuery, and SignOutCommand
  3. Install and Run the bot in Teams channel. From my end, I set up ngrok tunneling solution.
  4. In the bot sample code, put break point on method OnTeamsMessagingExtensionConfigurationQuerySettingUrlAsync
  5. In Teams, at the top nav search bar, @ mention the Messaging Extension Auth app.
  6. Select Tasks, and at the bottom right of the drop down, click the three dots ... 1055ebf9eedf527b166e791490ef0fef
  7. Notice the MessagingExtensionQuery query parameter in method OnTeamsMessagingExtensionConfigurationQuerySettingUrlAsync always returns the first command Id searchQuery instead of processQuery. image

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

Hey @JuanAr, we are reaching out to see if there is status update on this.

Thanks.

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

Hey @JuanAr, we are reaching out to see if there is status update on this.

Thanks.

Hi @ramfattah, this issue is on our backlog. We'll be tackling it next week. Thanks.

JuanAr avatar Oct 12 '22 22:10 JuanAr

We reproduced the issue and found that it's the MSTeams client the one sending the wrong commandId in the property value of the activity (documentation here). We consider this issue can be closed as there's nothing to fix on the SDK.

ceciliaavila avatar Oct 17 '22 20:10 ceciliaavila

Thank you @ceciliaavila. Closing as this issue is not related to Bot Framework SDK.

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

Reopening, will notify Teams during sync meetings.

tracyboehrer avatar Oct 18 '22 14:10 tracyboehrer