AdaptiveCards icon indicating copy to clipboard operation
AdaptiveCards copied to clipboard

[BUG] Send button on adaptive card broken

Open sschoeb opened this issue 1 year ago • 12 comments

Target Platforms

Other

SDK Version

1.5

Application Name

Microsoft Teams

Problem Description

We see more and more issues with our adaptive cards when using buttons to send information. From having this issue once in a while we now have customers

See the following video: https://github.com/microsoft/AdaptiveCards/assets/2493698/7de2f68c-7974-4073-81b4-3214ebe6435d

This bug appears on certain installations more often then in others. e.g. we cannot reproduce it on our own installation, but we can see it on several customers a lot.

We tracked down the issue to the following: When clicking a button in the adaptive card, the following request is executed: POST https://emea.ng.msg.teams.microsoft.com/v1/agents/28:4112cc9a-d683-4ffd-b0bc-2013af7c7497/invoke

The request contains the following content:

{
  "name": "messageback",
  "messageType": "RichText/Media_Card",
  "value": {
    "sendText": "A"
  },
  "imdisplayname": "<Name of the user>",
  "userAadToken": "<access token>",
  "serverMessageId": "1711540995092",
  "clientMessageId": "1362628173875898871"
}

But this request fails with the following response:

HTTP 400 Bad Request with the following content:

{
    "errorCode": 201,
    "message": "Invalid JSON payload.",
    "standardizedError": {
        "errorCode": 201,
        "errorSubCode": 1,
        "errorDescription": "Invalid JSON payload."
    }
}

This issue does make the application unusable for a lot of users, as most of the time the just end up with this error. We on the other side never get called in out bot, as it fails before already.

Other interesting stuff:

  • Happens way more often in the new teams client (we have a few users where we can reproduce it close to 100% of the time, therefore teams is currently unusable for them). But we had reports already before on the old client (but way less often)
  • Sending a normal text works just fine
  • Issue happens in web and also on the windows teams client

Please let me know if you need any further information. We could also provide phone support or whatever you need to get this fixed.

Screenshots

image

Card JSON

{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.5",
    "body": [
        {
            "type": "ColumnSet",
            "columns": [
                {
                    "type": "Column",
                    "width": "stretch",
                    "items": [
                        {
                            "type": "TextBlock",
                            "text": "",
                            "wrap": true,
                            "fontType": "Default",
                            "size": "Small"
                        }
                    ]
                },
                {
                    "type": "Column",
                    "width": "auto",
                    "items": [
                        {
                            "type": "TextBlock",
                            "text": "",
                            "fontType": "Default",
                            "size": "Small",
                            "horizontalAlignment": "Right"
                        }
                    ]
                }
            ]
        },
        {
            "type": "TextBlock",
            "text": "",
            "height": "stretch",
            "wrap": true
        },
        {
            "type": "Input.ChoiceSet",
            "id": "sendText",
            "style": "expanded",
            "choices": [
                {
                    "title": "A) Answer A",
                    "value": "A"
                },
                {
                    "title": "B) Answer B",
                    "value": "B"
                },
                {
                    "title": "C) Answer C",
                    "value": "C"
                }
            ],
            "isMultiSelect": true,
            "wrap": true
        },
        {
            "type": "Container",
            "items": [
                {
                    "type": "ActionSet",
                    "actions": [
                        {
                            "type": "Action.Submit",
                            "title": "",
                            "data": {
                                "msteams": {
                                    "type": "messageBack",
                                    "displayText": "",
                                    "value": {
                                        "sendText": ""
                                    }
                                }
                            },
                            "msteams": {
                                "feedback": {
                                    "hide": true
                                }
                            }
                        }
                    ]
                }
            ]
        }
    ]
}

Sample Code Language

No response

Sample Code

No response

sschoeb avatar Mar 27 '24 13:03 sschoeb

@anna-dingler pinging you as this bug/issue makes an adaptivecard within a bot completely useless. As we see customers having 80 to 100% of the time issues with these actions, I would consider that somehow urgent. I hope your team can find time to look into it (or at least guide us to another place to report that issue, if this repository should be wrong).

sschoeb avatar Mar 28 '24 08:03 sschoeb

Additional information:

  • We do not see any error in Azure Bot services, which relate to that problem.

sueess avatar Mar 28 '24 11:03 sueess

@jwoo-msft thank you very much for the proper tagging. May I ask you for a response if the report here is where it should be or if we should report this kind of issue somewhere else?

As from the 1 of april on based on your teams rollout policy the new teams client will be the default client, we consider this as urgent, as we expect to see this issue on way more of our customers. Would be great if we could at least find the correct place to report the issue and of course we would highly appreciate if someone could even look at it.

sschoeb avatar Mar 28 '24 17:03 sschoeb

Hi @sschoeb and @sueess, this issue should be filed with the Teams team directly. I can find contact info for you if you need :)

anna-dingler avatar Mar 28 '24 17:03 anna-dingler

@anna-dingler thank you very much, a contact info would be great :-)

sschoeb avatar Mar 28 '24 17:03 sschoeb

@dclaux Do you have a contact here?

anna-dingler avatar Mar 28 '24 22:03 anna-dingler

@anna-dingler thank you very much for the link!

@dclaux Sorry for pushing, but a contact or any feedback on that would be great, as the new teams version is default since yesterday our first customers start to move away from using teams but the web version instead (which is an absolute downgrade, but as teams is absolutely unusable the only workaround :/).

sschoeb avatar Apr 02 '24 07:04 sschoeb

@dclaux / @anna-dingler we found an additional (maybe important) information:

Having my own teams which is working, I could see that my invoke request looks like this:

{
   "name":"messageback",
   "messageType":"RichText/Media_Card",
   "value":{
      "sendText":"Falsch"
   },
   "imdisplayname":"<display name>",
   "userAadToken":"<token>",
   "serverMessageId":"1712326154213",
   "clientMessageId":"13250346427536952513",
   "conversation":{
      "id":"<id of the conversation>"
   }
}

What we can see here is, that in my (working) environment, teams does send additionally a conversation with an id. (which in my understanding also makes sense). This information is missing in the request we have above where we get a "Invalid JSON" back from the backend.

Do you need any further information on this? I could link you with our customer where we can 100% reproduce this issue if you need a real example.

Edit: I double checked the HAR-file I got from our customer and there I can see that requests to the /invoke-endpoint with the conversationId do work and all the requests without a conversationId do fail. Sadly most of the time teams does not send this conversationId!

sschoeb avatar Apr 05 '24 14:04 sschoeb

Is there any progress on that one? We are getting more and more reports of users for which the bots a completely not working. Is there any place to report issues like that? I guess it must be also in the interest of Microsoft, that the bots start to work reliable with the new Teams version.

sueess avatar Apr 08 '24 14:04 sueess

@sueess, As previously mentioned, the solution will not involve AdaptiveCards (AC), since AC does not manage the communication between the hosting application that utilizes AC and the bot. It would be best to contact the teams that can directly address your issue.

jwoo-msft avatar Apr 08 '24 18:04 jwoo-msft

@jwoo-msft Thanks for your reply.

We would love to contact the teams that can directly address the issue, but we just do not know how - any link to a person would be very much appreciated. Or is there another place to report that bug?

sschoeb avatar Apr 08 '24 20:04 sschoeb

@jwoo-msft I understand your point. However, isn't it also in your interest, that the stuff you guys develop is at the end working? What is a nice train on broken rails? We are more then eager to report the issue at the right place, but so far nobody could give us any hint, how to reach a responsible person.

We would really appreciate a contact, to reduce the pain of "our" customers and the users. I guess we would all be happy about that. Many thanks for some directions!

sueess avatar Apr 12 '24 08:04 sueess

Dear @jwoo-msft @dclaux @anna-dingler - I understand, that we are in the wrong repository here. But it is super hard to figure out where to report these kind of bugs? We tried multiple repositories, we tried our support on azure (which does not care to much about teams).. so it would be great if you could give us any hint on where we should go next with this one. Is there any support plan where we could get access to someone who cares about bug reports? Or any other option?

sschoeb avatar May 21 '24 07:05 sschoeb

@sschoeb the issue should now be fixed in Teams. Are you still able to repro in Teams web/desktop?

dclaux avatar May 21 '24 15:05 dclaux

@dclaux No we do currently not see this error on any of our clients. But as we never had a feedback and the bug also before was not consistent we were not sure if it was fixed or not. But these are great news - thank you very much for your fixing the issue and also the update in here!

As a last question: As you may have seen in this report here, we are having a hard time reporting these kind of bugs to Microsoft. We wonder if this what we are doing here is the way to go or if you would recommend to contact Microsoft somehow else?

sschoeb avatar May 22 '24 05:05 sschoeb

Closing this issue since it has been fixed. @dclaux @jwoo-msft Is there any easier way to file these issues in the future?

Thanks, Anna

anna-dingler avatar Jun 24 '24 16:06 anna-dingler