You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reporting a message inside a thread crashes the chat #1465
Reporting a message from inside a thread crashes EmbeddedChat.
In packages/react/src/views/Thread/ThreadMessageList.js the report window is rendered as <MessageReportWindow messageId={messageToReport} />, without the message prop. MessageList passes message={reportedMessage}, but the thread view doesn't. ReportWindowButtons then calls messageDescription(message) with undefined, and if (msg.file) throws.
ChatBody renders either ThreadMessageList or MessageList, so inside a thread this is the only report window and it fails every time. There's no error boundary, so the whole widget goes blank.
Steps to reproduce:
Open a thread
Open the message toolbox on any message in the thread and click "Report"
Expected behavior:
The report window opens with the message preview, same as in the main chat.
Actual behavior:
TypeError: Cannot read properties of undefined (reading 'file') and the chat crashes.
I have a small fix ready (look up the reported message from the thread's messages and pass it in, plus a null check in messageDescription) and will open a PR.
Activity