microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.
MIT License
7.49k stars 2.44k forks source link

Newer version of Teams incorrectly parses messages with at mentions #6617

Closed nodkrot closed 2 months ago

nodkrot commented 11 months ago

Version

In versions greater than 1.5.00.26358

Describe the bug

We noticed that at mentions formatting started to have unexpected behavior where it breaks down single users name into multiple at mentions. See examples below.

To Reproduce

Using RSC to receive channel messages in the manifest, send a message in the channel with an at mention. Activity payload comes in like so:

  "text": "<at>Zzzz</at> <at>Ee</at> <at>Aaaa</at>",
  ...
  "entities": [
    {
      "mentioned": {
        "id": "29:1tYwtgp56UKjOlsdfsefs3fsesfsfVP78kWJ-x5Nr9OKj1Ls50S06Gq_cNs3VPyjiGyMGvZk4k6e8OHey9yJDw",
        "name": "Zzzz"
      },
      "text": "<at>Zzzz</at>",
      "type": "mention"
    },
    {
      "mentioned": {
        "id": "29:1tYwtgp56UKjOlsdfsefs3fsesfsfVP78kWJ-x5Nr9OKj1Ls50S06Gq_cNs3VPyjiGyMGvZk4k6e8OHey9yJDw",
        "name": "Ee"
      },
      "text": "<at>Ee</at>",
      "type": "mention"
    },
    {
      "mentioned": {
        "id": "29:1tYwtgp56UKjOlsdfsefs3fsesfsfVP78kWJ-x5Nr9OKj1Ls50S06Gq_cNs3VPyjiGyMGvZk4k6e8OHey9yJDw",
        "name": "Aaaa"
      },
      "text": "<at>Aaaa</at>",
      "type": "mention"
    }
  ],

Expected behavior

  "text": "<at>Zzzz Ee Aaaa</at>",
  ...
  "entities": [
    {
      "mentioned": {
        "id": "29:1tYwtgp56UKjOlkjJU3J6RcLNRKYJWVP78kWJ-x5Nr9OKj1Ls50S06Gq_cNs3VPyjiGyMGvZk4k6e8OHey9yJDw",
        "name": "Zzzz Ee Aaaa"
      },
      "text": "<at>Zzzz Ee Aaaa</at>",
      "type": "mention"
    }
  ],

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

nodkrot commented 11 months ago

Bumping this up

nodkrot commented 11 months ago

Hey @ceciliaavila, did you get a chance to reproduce this issue?

nodkrot commented 10 months ago

Could you guys provide an ETA when someone can confirm this issue?

ceciliaavila commented 10 months ago

Could you guys provide an ETA when someone can confirm this issue?

Hi @nodkrot, we have this issue in our backlog. We will probably work on it next week.

LuchoPeres commented 10 months ago

Hi @tracyboehrer @nodkrot,

We've successfully reproduced the reported issue. During our investigation, we traced back the chain of calls to turnContext.Activity.Text. And while debugging, we discovered that in the CloudAdapter class, particularly within the ProcessAsync method responsible for handling inbound HTTP requests, the HTTP request's body already contains the incorrectly parsed username in its text property.

This means that the issue arises before reaching BotBuilder, implicating Teams as the likely source of the problem. Therefore, it is advised to forward this issue to the Microsoft team responsible for Teams development for resolution.

CloudAdapter ProcessAsync method image_6617

nodkrot commented 10 months ago

Thank you for looking into this. Could let us know how can we reach out to them? I would assume this is something that you guys could do a lot faster than us.

ceciliaavila commented 10 months ago

Hi @tracyboehrer, can you please forward this issue to the MSTeams team? Thanks!

nodkrot commented 9 months ago

Hey @ceciliaavila @tracyboehrer were you guys able to forward this? Is there a place where we can check on the progerss?

tracyboehrer commented 8 months ago

@nodkrot Apologies for the delay. This has been forwarded to Teams for guidance.

tracyboehrer commented 8 months ago

The fix for this is rolling out in Teams. I do not have an ETA when that fix will be live yet. Will update this issue when the rollout is expected/complete.