microsoft-graph-toolkit icon indicating copy to clipboard operation
microsoft-graph-toolkit copied to clipboard

[BUG] App/Bot names don't show in chat

Open plasne opened this issue 1 year ago • 2 comments

Describe the bug If chatting with a bot in a group chat, the name of the app/bot will not show next to the datetime and before the message. Unfortunately, this means you don't know who sent the message, a real issue if more than one bot is in a group chat.

To Reproduce Steps to reproduce the behavior:

  1. Create a group chat in Teams
  2. Add one or more apps with bots
  3. Send a bot a message and wait for a response
  4. Look at the response in MGT
  5. Notice that you don't know who sent the message

Expected behavior As with users the sender should visible.

Screenshots If applicable, add screenshots to help explain your problem.

image

Environment (please complete the following information):

  • OS: MacOS
  • Browser: Edge
  • Framework: React
  • Provider: Msal2Provider

Additional context This appears to be because the control comes from the ACS component UI library and it only sends the user info, not the full identity block that is sent by the Graph API.

{
    "application": {
        "applicationIdentityType": "bot",
        "id": "0c5cfdbb-596f-4d39-b557-5d9516c94107",
        "displayName": "App Studio"
    },
    "device": null,
    "user": null
}

plasne avatar Jan 12 '24 22:01 plasne

This is valid and I could reproduce them during some of my endeavors in the past. I see it even as a compliance / trust issue. This should get fixed and our stateful client should "know" about these users and format the content / name accordingly.

sebastienlevert avatar Jan 15 '24 16:01 sebastienlevert

At present the best we can do is ensure that the display name is set correctly on the messages like this: bot display name

This is because, as @plasne noted the callback provided as a render prop only receives the id of the message author and no additional data.

I'll raise this with the ACS team to see if we can get some expansion of the data made available to the onRenderAvatar callback. Likely this also needs some expansion of the author data on the message object itself to support differentiation between human users and bots.

gavinbarron avatar Feb 15 '24 22:02 gavinbarron