Rocket.Chat
Rocket.Chat copied to clipboard
"Uncaught Error" in some group chats with new message template in Desktop App
Description:
"Oops! Something went wrong. Please reload the page or contact an administrator." error while viewing some chats. Problem occurs only in Desktop App and only for some group chats (I haven't found any differences in chats working fine and failing). Browser version works fine for all chats failing in Desktop app.
Enabling "Use legacy message template" in My Account > Preferences fixes the problem.
Steps to reproduce:
- Open some chat created in previous RC version in Desktop App.
Expected behavior:
Chat is opened, all messages are visible, history is being loaded while scrolling.
Actual behavior:
[+] chat opened
[+] message history shown
[!] in 2-3 seconds after chat is opened and message history shown
Server Setup Information:
- Version of Rocket.Chat Server: 5.0.4
- Operating System: Unubtu 20.04
- Deployment Method: docker
- Number of Running Instances: 1
- DB Replicaset Oplog: oplog Enabled
- NodeJS Version: v14.19.3
- MongoDB Version: 5.0.11 / wiredTiger
Client Setup Information
- Desktop App or Browser Version: Desktop App v 3.8.7
- Operating System: Windows 10
Additional context
none
Relevant logs:
Browser logs:
[Browser logs pasted as text here become unreadable]
"componentStack" property for Uncaught Error: TypeError: Cannot read properties of undefined (reading 'indexOf')
(num.2 on the screenshot)
"
at O (/client/views/room/MessageList/components/MessageContent.tsx:1:1719)
at div
at va
at div
at https://chat.domain.ltd/de2a0a98a668e5a193ce98f6f7dfcb36e7148079.js?meteor_js_resource=true:13:504489
at v (/client/views/room/MessageList/components/Message.tsx:1:1156)
at a (/client/views/room/MessageList/providers/MessageHighlightProvider.tsx:1:311)
at l (/client/views/room/providers/SelectedMessagesProvider.tsx:1:1022)
at e (/client/views/room/providers/MessageProvider.tsx:1:999)
at B (/client/views/room/providers/ToolboxProvider.tsx:1:997)
at e (/client/views/room/MessageList/providers/MessageListProvider.tsx:1:1231)
at t (https://chat.domain.ltd/de2a0a98a668e5a193ce98f6f7dfcb36e7148079.js?meteor_js_resource=true:1044:29683)
at d (/client/views/room/MessageList/MessageListErrorBoundary.tsx:1:400)
at q (/client/views/room/MessageList/MessageList.tsx:1:1413)
at Suspense
at https://chat.domain.ltd/de2a0a98a668e5a193ce98f6f7dfcb36e7148079.js?meteor_js_resource=true:1558:1129517
at p (/client/views/root/AppLayout.tsx:1:424)
at m (https://chat.domain.ltd/de2a0a98a668e5a193ce98f6f7dfcb36e7148079.js?meteor_js_resource=true:1558:1054424)
at d (/client/components/message/Attachments/providers/AttachmentProvider.tsx:1:362)
at L (/client/providers/OmnichannelProvider.tsx:1:1010)
at Q (/client/providers/CallProvider/CallProvider.tsx:1:1792)
at g (/client/providers/VideoConfProvider.tsx:1:618)
at P (/client/providers/AuthorizationProvider.tsx:1:932)
at d (/client/providers/ModalProvider.tsx:1:349)
at d (/client/providers/DeviceProvider/DeviceProvider.tsx:1:388)
at g (/client/providers/UserProvider.tsx:1:813)
at c (/client/providers/CustomSoundProvider.tsx:1:245)
at v (/client/providers/AvatarUrlProvider.tsx:1:489)
at r (/client/providers/LayoutProvider.tsx:1:350)
at y (/client/providers/SettingsProvider.tsx:1:706)
at h (/client/providers/ToastMessagesProvider.tsx:1:453)
at p (/node_modules/@rocket.chat/fuselage-toastbar/dist/esm/ToastBarProvider.js:1:709)
at g (/client/providers/ToastMessagesProvider.tsx:1:748)
at v (/client/providers/TooltipProvider.tsx:1:435)
at l (/client/providers/SessionProvider.tsx:1:353)
at d (/client/providers/TranslationProvider.js:1:1203)
at k (/client/providers/RouterProvider.tsx:1:967)
at h (/client/providers/ServerProvider.tsx:1:1002)
at i (/client/providers/ConnectionStatusProvider.tsx:1:399)
at D (/client/providers/MeteorProvider.tsx:1:1150)
at e (https://chat.domain.ltd/de2a0a98a668e5a193ce98f6f7dfcb36e7148079.js?meteor_js_resource=true:1218:63317)
at Suspense
at f"
SERVER LOGS No relevant logs
@debdutdeb this doesn't seem to be an Electron issue. Did you take a look at the logs?
The issue mentioned this only happening on the desktop app 🙈 made sense to transfer here for further investigation.
This is /app/bundle/programs/web.browser/dynamic/client/views/room/MessageList/components/MessageContent.tsx
file (pretty-printed) in RockerChat Docker container:
It has been mentioned in DevConsole error. Adding two highlighted conditions to the file fixes my problem (checked by editing source directly in container and restarting server, cleaning cache and storage data in client). Unfortunately, I'm new to Meteor, React and TypeScript, and can't find corresponding source in RC/RC.Electron repo.
This is
/app/bundle/programs/web.browser/dynamic/client/views/room/MessageList/components/MessageContent.tsx
file (pretty-printed) in RockerChat Docker container:It has been mentioned in DevConsole error. Adding two highlighted conditions to the file fixes my problem (checked by editing source directly in container and restarting server, cleaning cache and storage data in client). Unfortunately, I'm new to Meteor, React and TypeScript, and can't find corresponding source in RC/RC.Electron repo.
I think that this is the line: https://github.com/RocketChat/Rocket.Chat/blob/develop/apps/meteor/client/views/room/MessageList/components/MessageContent.tsx#L85
Please @debdutdeb could you validate this?
Seems that issue should be returned to Rocket.Chat repo.
Found issues in https://github.com/RocketChat/Rocket.Chat repo:
apps/meteor/client/views/room/MessageList/components/MessageContent.tsx:85
and
apps/meteor/client/views/room/MessageList/components/MessageContent.tsx:92
Checks for message.replies
should be added.
Thanks for checking folks. You're right. Transfering to main repo. BTW - PRs are welcome ;)
BTW - PRs are welcome ;)
@debdutdeb , preparing one now)
Still here in 5.1.2. Hasn't fix above been included to 5.1.2 build?