Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Send button on adaptive card broken #10751

Closed
ChetanSharma-msft opened this issue Apr 18, 2024 · 19 comments
Closed

[BUG] Send button on adaptive card broken #10751

ChetanSharma-msft opened this issue Apr 18, 2024 · 19 comments
Assignees
Labels
bug teams-developer-support Question related to extensibility (Bot, ME, Tab) would be marked under this label

Comments

@ChetanSharma-msft
Copy link
Collaborator

ChetanSharma-msft commented Apr 18, 2024

Error details

Copied bug from: microsoft/AdaptiveCards#8864

Details from original post:
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": "",
"userAadToken": "",
"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

@ChetanSharma-msft ChetanSharma-msft added the teams-developer-support Question related to extensibility (Bot, ME, Tab) would be marked under this label label Apr 18, 2024
@ChetanSharma-msft
Copy link
Collaborator Author

Thanks for raising the query.
We will look into it and let you know the updates.

@sschoeb
Copy link

sschoeb commented Apr 18, 2024

Thanks for posting this bug also here.

I want to note, that this is clearly a bug in teams. Important details also in this comment of the original report:
microsoft/AdaptiveCards#8864 (comment)

@Vaibhav-MSFT
Copy link

Hello @sschoeb ,
We tested with the json you shared and it is working fine from our end. We are able to receive the conversation id from the payload.
Can you please let us know the teams js version you are using?

@sschoeb
Copy link

sschoeb commented Apr 19, 2024

Hi @Vaibhav-MSFT

Thank you very much for your reply. As mentioned in the bug report, this is not something we can reproduce on our installation, but we have a customer who had this on more or less each of his clients. And not just they, we saw it on multiple customers.. some have it more, some less. Versions are different from latest to 1-2 months old (but always Teams 2.x). We had it in web, mobile and desktop....

but as you have asked, here a version number which was sometimes completely broken:
24060.2623.2790.8046
49/24031414712

Before you now start running and testing on that version: Yes, it will most probably work on your computer with that version! BUT: this is not always the case. It is very often the case that it just does not. Could you try and sit together with the responsible person to figure out in which case there is no conversationId sent? There must be the case as we could proof that multiple times.

I think there is a lot of information in the initial bugreport. Let me know if you need anything else.

@Vaibhav-MSFT
Copy link

Hello @sschoeb ,
Thanks for the clarification but as we are not able to repro it form our side can you please provide us with some error logs so that we can furthur discuss it with engineering team.

@sschoeb
Copy link

sschoeb commented Apr 19, 2024

I really don't know what else I should provide. Please clarify on what you need. Meanwhile I repeat from my previous posts:

Within teams we see requests to the invoke-endpoint rejected with the following error:

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

This we can see when your teams application tries to do a call to:
POST https://emea.ng.msg.teams.microsoft.com/v1/agents/28:4112cc9a-d683-4ffd-b0bc-2013af7c7497/invoke

With the following content:

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

As you can see in the content, there is no ConversationId. And because you application is not sending the conversationId to your backend, your app is not working.

Here additionally an example on how the content for this call should look like:

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

As you can clearly see, there is a conversation object including an id on this call. This call worked as expected.

Just one more time to be clear what this is about:
This is a bug within Microsoft Teams (Web, Desktop, Mobile) where we do not have any impact on it. It is not something we could change, it is just your app not working sometimes! There must be a clear path in your code where you put together this object which is sent to your /invoke-endpoint where it is possible that the conversation is undefined.

I hope this helps, let me know if you need any specific information!

@ChetanSharma-msft
Copy link
Collaborator Author

Hello @sschoeb - Thanks for sharing the details. We will look into it and let you know the updates.

@Meghana-MSFT
Copy link
Collaborator

We raised an incident for this issue and informed respective engineering team. We will keep you posted on the updates.

@sschoeb
Copy link

sschoeb commented Apr 29, 2024

@ChetanSharma-msft / @Meghana-MSFT is there any statement on the priority? When could we at least expect an answer (even just a "yes we can confirm that there is the possibility that something can go wrong")?

@ChetanSharma-msft
Copy link
Collaborator Author

Hello @sschoeb - We are actively checking on it with engineering team and let you know the updates.

@Meghana-MSFT
Copy link
Collaborator

@sschoeb - Engineering team is investigating this issue and they have installed the app in a test tenant but they require an 'organization code' from Micromate to try the app and check the same flow as the video. For now, they haven't been able to reproduce the issue with other apps, the required data is passed correctly.

Could you please share the 'organization code' at microsoftteamsdev@microsoft.com, so that team can investigate further.

@sschoeb
Copy link

sschoeb commented May 10, 2024

@Meghana-MSFT thanks for your reply. I've sent you a code to the given email through which you can join a demo organization.

But as already mentioned before:
The chance is high, that you will not be able to reproduce this! So please do not answer with "Sorry cannot reproduce". As this bug happened a lot for some customers of us (but not all) it can absolutely be the case that it does not happen on your side.

But what we are sure is, that somehow your code allows to not pass a conversation id to the /invoke call. You should be able to find this casein the code!

@Meghana-MSFT
Copy link
Collaborator

Thank you. We will share this information with engineering team.

@sschoeb
Copy link

sschoeb commented May 21, 2024

@Meghana-MSFT any news on this?

@Meghana-MSFT
Copy link
Collaborator

We have the following recommendation from engineering team - Could you please try updating to the latest version and if that doesn't work, do a clear cache Clear Teams cache - Microsoft Teams | Microsoft Learn.

Engineering team has fixed another issue, and that fix might be applicable to this as well. Could you please check and confirm once?

@sschoeb
Copy link

sschoeb commented May 22, 2024

I can confirm, that the issue seems to be gone. Thanks for the reply on this @Meghana-MSFT.

@Meghana-MSFT
Copy link
Collaborator

@sschoeb - Glad your issue has been resolved, thank you for confirming. Could you please share your kind feedback at https://forms.office.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR7iCOpS5_b9Nqmwx43u5rtZUOThVR081SllSR05aSDQxQ0tUMDVPTVIxTi4u

@ChetanSharma-msft
Copy link
Collaborator Author

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

Copy link
Contributor

Tell us about your experience!

Hi ChetanSharma-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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug teams-developer-support Question related to extensibility (Bot, ME, Tab) would be marked under this label
Projects
None yet
Development

No branches or pull requests

4 participants