MicrosoftDocs / msteams-docs

Source for the Microsoft Teams developer platform documentation.
https://aka.ms/teamsdev
Creative Commons Attribution 4.0 International
288 stars 511 forks source link

"Unable to reach app" error during submit action in adaptive cards from MS Teams App #6581

Closed Wajeed-msft closed 2 years ago

Wajeed-msft commented 2 years ago

Copied bug from: https://github.com/microsoft/AdaptiveCards/issues/7712

Details from original post:

Target Platforms

Other

SDK Version

Microsoft Azure BOT Framework v4

Application Name

Microsoft Teams

Problem Description

While making a submit action in the adaptive card from MS Teams App, the card is throwing with an error "Unable to reach app. Please try again". I understand this might be due to delay in BOT response. This is creating bad user experience, as it misleads the bot users, because our bot would respond after 15 secs.

Is there way to fix this error or an option to suppress this message ?

Appreciate if you could help is resolving this.

Note: I am not getting this issue with the Web Channel. I am only getting from the Teams Channel.

Application details:

  1. Azure Web App Bot built on Azure BOT Framework v4.
  2. MS Teams App as Messenger Channel.
  3. Adaptive Cards

Thanks.

adaptivecard-submitaction-issue

InvoiceStatusFormEn.txt

Screenshots

adaptivecard-submitaction-issue

Card JSON

{
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "type": "AdaptiveCard",
  "version": "1.0",
  "body": [
    {
      "type": "TextBlock",
      "text": "Any status will exclude Track Invoices",
      "wrap": true,
      "weight": "bolder"
    },
    {
      "type": "TextBlock",
      "text": "Please provide below detail for Vendor Invoice Status Request :",
      "wrap": true
    },
    {
      "type": "TextBlock",
      "text": "Purchase Order Number"
    },
    {
      "type": "Input.Text",
      "id": "PurchaseOrderNumber1",
      "placeholder": "Purchase Order Number"
    },
    {
      "type": "TextBlock",
      "text": "OR",
      "horizontalAlignment": "Center"
    },
    {
      "type": "TextBlock",
      "text": "Purchase Order Number + Vendor Invoice Reference Number",
      "wrap": true
    },
    {
      "type": "Input.Text",
      "id": "PurchaseOrderNumber2",
      "placeholder": "Purchase Order Number"

    },
    {
      "type": "Input.Text",
      "id": "ReferenceNumber1",
      "placeholder": "Vendor Invoice Reference Number"
    },
    {
      "type": "TextBlock",
      "text": "OR",
      "horizontalAlignment": "Center"
    },
    {
      "type": "TextBlock",
      "text": "Vendor Number + Vendor Invoice Reference Number",
      "wrap": true
    },
    {
      "type": "Input.Text",
      "id": "VendorNumber",
      "placeholder": "Vendor Number"
    },
    {
      "type": "Input.Text",
      "id": "ReferenceNumber2",
      "placeholder": "Vendor Invoice Reference Number"
    }

  ],
  "actions": [
    {
      "type": "Action.Submit",
      "title": "Submit",
      "data": {
        "actionType": "InvoiceStatusEn"
      }
    },
    {
      "type": "Action.Submit",
      "title": "Cancel",
      "associatedInputs": "none",
      "data": {
        "actionType": "Cancel"
      }
    }
  ]
}

Sample Code Language

C# 6.0

Sample Code

No response---

Document Details

Do not edit this section.It is required for docs.microsoft.com ➟ GitHub issue linking.

ghost commented 2 years ago

Hi Wajeed-msft! Thank you for bringing this issue to our attention. We will investigate and if we require further information we will reach out in one business day. Please use this link to escalate if you don't get replies.

Best regards, Teams Platform

sayali-MSFT commented 2 years ago

@JiaudheenAM-RTContractor -Thanks for reporting this issue. We will look into it and get back to you.

sayali-MSFT commented 2 years ago

@JiaudheenAM-RTContractor -If the bot doesn't complete the operation within 10 to 15 seconds, depending on the channel, the Azure Bot Service will time out and report back to the client a 504:GatewayTimeout, as described in How bots work.

For proper handling of managing long running operation please refer below doc. https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-howto-long-operations-guidance?view=azure-bot-service-4.0

We cannot suppress the error message. We can suppress the success message, set the attribute hide to true in the msTeams feedback property.

Following is an example:

 "content": {
      "type": "AdaptiveCard",
      "title": "Card with hidden footer messages",
      "version": "1.0",
      "actions": [
      {
          "type": "Action.Submit",
          "title": "Submit",
          "msTeams": {
              "feedback": {
              "hide": true
              }
          }
      }
      ]
  } 

Reference Doc: https://docs.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/conversation-messages?tabs=dotnet#form-completion-feedback

sayali-MSFT commented 2 years ago

Could you please confirm if your issue has resolved with above suggestion or still looking for any help?

JiaudheenAM-RTContractor commented 2 years ago

Could you please confirm if your issue has resolved with above suggestion or still looking for any help?

We are yet to deploy the change and test. Since that was a user facing chatbot, we have planned to deploy and test this week EOD. Will update on the same after testing. Appreciate your patience.

JiaudheenAM-RTContractor commented 2 years ago

Could you please confirm if your issue has resolved with above suggestion or still looking for any help?

The issue is not resolved yet. We are still getting this error popped up, even after setting "feedback": { "hide": true } .

Below is the template we tried with it,

{ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "type": "AdaptiveCard", "version": "1.0", "body": [ { "type": "Input.Text", "id": "GeneralRequestTicketNumber", "label": "Please provide a Valid P2P Concierge ticket number starting with GRT", "placeholder": "Request/ Ticket Number", "isRequired": true, "errorMessage": "Request/ Ticket Number is required" } ], "actions": [ { "type": "Action.Submit", "title": "Submit", "data": { "msteams": { "type": "messageBack", "text": "GeneralRequestTicketStatusEn", "value": "", "feedback": { "hide": true } } } }, { "type": "Action.Submit", "title": "Cancel", "associatedInputs": "none", "data": { "actionType": "Cancel" } } ] }


image

sayali-MSFT commented 2 years ago

To fix the error message Unable to reach app. Please try again. You have to handle the long running operations.

Suppress of error message is not supported. Could you please raise an user voice here: Microsoft Teams Community

ChetanSharma-msft commented 2 years ago

We are closing this issue for now, Please feel free to reopen it, if required.

ghost commented 2 years ago

Tell us about your experience!

Hi Wajeed-msft! This issue is closed in our system. We would like your feedback on your experience with our support team and Platform.

Best regards, Teams Platform