-
Notifications
You must be signed in to change notification settings - Fork 78
Alkwa/dont render html messages #1149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
85dffc8
dd8c85e
bffabd4
59130c7
3c8c19c
90e5653
0f5a308
56033b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "prerelease", | ||
| "comment": "avoid rendering richtext/media messages until we can properly handle it", | ||
| "packageName": "@internal/chat-stateful-client", | ||
| "email": "79329532+alkwa-msft@users.noreply.github.com", | ||
| "dependentChangeType": "patch" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,7 +62,14 @@ export class EventSubscriber { | |
| }; | ||
|
|
||
| private onChatMessageReceived = (event: ChatMessageReceivedEvent): void => { | ||
| // Today we are avoiding how to render these messages. In the future we can | ||
| // remove this condition and handle this message appropriately. | ||
| if (event.type !== 'Text' && event.type !== 'RichText/Html') { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are there concerns that we have to do it in stateful client? Since it is our component + selector's responsibility to render the message (and they don't support this type well), messages filter should be happening in messageThreadSelector.tsx - On the other hand, stateful client should always provide accurate data directly coming from js sdk (so developers can read messages and render them themselves even without our implementation) We already have some filterings there in messageThreadSelector.tsx, I wonder why it is not working, I guess there could be some leakings for our conditions there
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sync with Alex offline, the big limitation for now is we froze api changes so we are not able to support more types in convertEventType() function above - for short term, this change makes a lot of change before we release the lock of api changes |
||
| return; | ||
| } | ||
|
|
||
| const newMessage = this.convertEventToChatMessage(event); | ||
|
|
||
| // Because of bug in chatMessageReceived event, if we already have that particular message in context, we want to | ||
| // make sure to not overwrite the sequenceId when calling setChatMessage. | ||
| const existingMessage = this.chatContext.getState().threads[event.threadId]?.chatMessages[event.id]; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not need a condition for 'html'? https://github.com/Azure/communication-ui-library/pull/946/files
Looking to avoid breaking: #824
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: convert the type we are checking to lowercase and use the enumACSKnownMessageTypewe have for checking againstThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, 'html' type is coming from teams sometimes - not sure if that is also the case for notifications
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huge inconsistence of type name/lower/upper cases from chatThreadClient.getMessages() and these notifications, which should be resolved by our chat sdk in their further release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep I am going to toLowerCase() and do checks against text richtext/html and html
all other messages are currently dropped.