MicrosoftDocs / msteams-docs

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

BUG: Malformed @ mentions in Message extension payload #6476

Open aneesh631 opened 2 years ago

aneesh631 commented 2 years ago

The original message looks like

test add comment with mentions @Piyush Kumar and @Arka Dutta

When the message extension is invoked the payload looks like:

{
  ...,
  "value": {
    ...,
    "messagePayload": {
      ...,
      "body": {
        "contentType": "html",
        "content": "<p>test add comment with mentions <at id=\"undefined\"></at> <at id=\"undefined\"></at> and <at id=\"undefined\"></at> <at id=\"undefined\"></at><at id=\"undefined\"></at><semantic-object></semantic-object><at id=\"undefined\"></at><semantic-object></semantic-object></p>"
      },
      "mentions": [
        {
          "id": 0,
          "mentionText": "Piyush",
          "mentioned": {
            "device": null,
            "conversation": null,
            "user": {
              "userIdentityType": "aadUser",
              "id": "<piyush_user_id>",
              "displayName": "Piyush"
            },
            "application": null
          }
        },
        {
          "id": 1,
          "mentionText": "Kumar",
          "mentioned": {
            "device": null,
            "conversation": null,
            "user": {
              "userIdentityType": "aadUser",
              "id": "<piyush_user_id>",
              "displayName": "Kumar"
            },
            "application": null
          }
        },
        {
          "id": 2,
          "mentionText": "Arka",
          "mentioned": {
            "device": null,
            "conversation": null,
            "user": {
              "userIdentityType": "aadUser",
              "id": "<arka_user_id>",
              "displayName": "Arka"
            },
            "application": null
          }
        },
        {
          "id": 3,
          "mentionText": "Dutta",
          "mentioned": {
            "device": null,
            "conversation": null,
            "user": {
              "userIdentityType": "aadUser",
              "id": "<arka_user_id>",
              "displayName": "Dutta"
            },
            "application": null
          }
        }
      ]
    }
  }
}

As you can see the mentions are malformed and every username is separated into space separated tokens. When the message is read using the graph api the mentions show up properly, i.e. one mention entry for a single mention. Can you open a bug for this? Thanks.


Document Details

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

ghost commented 2 years ago

Hi aneesh631! 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

Nivedipa-MSFT commented 2 years ago

@aneesh631 - Could you please share repro steps to try at our end?

Nivedipa-MSFT commented 2 years ago

@aneesh631 - How are you creating and generating the messaging extension payload? Can you please share the repro steps or reference doc if any?

aneesh631 commented 2 years ago

Steps:

  1. Create an Azure bot with a Teams channel switched on, and a teams app that can be installed in a group chat scope. Add a message extension to it.
  2. Create a group chat with a couple of users in it. Add the teams app to it.
  3. Send a message in the group chat with user mentions.
  4. Invoke the message extension on that message.
  5. The payload received for this activity has malformed mentions. The payload that I specified in my earlier message highlights what is exactly wrong with it.
Nivedipa-MSFT commented 2 years ago

@aneesh631 - We are able to repro this issue and we have raised a bug for it. We will let you know once we get updates on it.

matthiasdilger commented 2 years ago

@Nivedipa-MSFT The same issue occurs when @mentioning a bot together with other user mentions.

Example: Add a bot to a group chat that has other users @mention the bot together with other users "John Doe" and "Jane Doe" like so:

@bot @Jane Doe @John Doe this is a test

The bot will receive an activity with a total of 5 mentions instead of 3. This used to work fine.

Nivedipa-MSFT commented 2 years ago

@matthiasdilger - We have added this scenario in bug. We will let you know when there is an update on bug.

aneesh631 commented 2 years ago

@Nivedipa-MSFT just checking in, do we have any updates?

ghost commented 2 years ago

Tell us about your experience!

Hi aneesh631! 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

ghost commented 2 years ago

Hi aneesh631! 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

Nivedipa-MSFT commented 1 year ago

@aneesh631 - Engineering team is working on it. We will let you know once we have any updates on it.

aneesh631 commented 1 year ago

@Nivedipa-MSFT any updates on this?

Nivedipa-MSFT commented 1 year ago

@aneesh631 - We are checking the status of the bug with engineering team. We will let you know once we get any updates from them.

ChetanSharma-msft commented 1 year ago

Hello @aneesh631 - Engineering team is not able to repro this issue. However we will again try to repro your scenario and let you know the updates.

ChetanSharma-msft commented 1 year ago

I apologize for delay in response. We are actively checking this issue from our end and will let you know the updates.

Thanks!!

ChetanSharma-msft commented 1 year ago

I apologize for delay in response. We are actively checking this issue from our end and will let you know the updates.

Thanks!!