microsoftgraph / microsoft-graph-toolkit

Authentication Providers and UI components for Microsoft Graph 🦒
https://docs.microsoft.com/graph/toolkit/overview
Other
924 stars 287 forks source link

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

Open plasne opened 5 months ago

plasne commented 5 months ago

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):

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
}
sebastienlevert commented 5 months ago

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.

gavinbarron commented 4 months ago

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.