microsoftgraph / microsoft-graph-toolkit

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

[BUG][mgt-chat] HTML tags visible after editing chat within MGT mgt-chat component #3155

Open Laurence-V opened 7 months ago

Laurence-V commented 7 months ago

Describe the bug When editing in the mgt-chat component of MGT, the client renders HTML tags, these then persist on web/fat client if changes are made and saved. The HTML tags are not rendered in the mgt-chat component on saving.

To Reproduce Steps to reproduce the behavior in MGT:

  1. Go to a system running chats using MGT
  2. Click on a message you have sent to get the context menu and select Edit
  3. The message will become editable
  4. Error: The message now shows the HTML tags, while in Edit Mode

To see in Web/Fat client

  1. Make a change while in the MGT chat component, while in Edit Mode
  2. Accept change
  3. Go message to Web/Fat client
  4. Error: The message now shows the HTML tags

Expected behavior HTML tags should not be visible in the clients

Screenshots In Edit Mode in MGT Chat Component: Screenshot 2024-04-03 at 14 15 05 In fat client (not edit mode): Screenshot 2024-04-03 at 14 15 28 In web client (not edit mode): Screenshot 2024-04-03 at 14 14 45

Environment (please complete the following information):

musale commented 6 months ago

@Laurence-V this is a valid bug. I'm moving it to our backlog and it'll be fixed as soon as possible

Laurence-V commented 6 months ago

Thanks @musale,
I've also noticed that in the MGT component, Less Than and Greater Than get converted into HTML And that HTML Tags get rendered correctly i.e. with <> but they also get auto completed in the MGT component Whereas in the (New) Teams client, they are rendered as entered.

Messages entered from Microsoft Graph Toolkit MGT_Component

Messages displayed in Teams Client TeamClient

musale commented 6 months ago

@Laurence-V the processing of the Teams messages in mgt-chat is done by parsing the html text so I would suggest that these edge cases are given an independent look. Could you make this another issue so that we can track other scenarios too?