RocketChat / RocketChat/Rocket.Chat
Error ([500]) in channels imported from Slack with Full Name option enabled
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
Error ([500]) in channels imported from Slack with Full Name option enabled
Steps to reproduce:
- Import Channels and users from slack
- Enable "Use Real Name" option on Layout -> User interface
- Click on a Channel imported from slack with lots of messages
- Error [500] is present
Expected behavior:
No error in opening a channel imported from Slack
Actual behavior:


Server Setup Information:
- Version of Rocket.Chat Server: 3.6.1
- Operating System: Linux
- Deployment Method: docker
- Number of Running Instances: 1
- DB Replicaset Oplog:
- NodeJS Version: v12.16.1
- MongoDB Version: 4.0.20
Client Setup Information
- Desktop App or Browser Version: Google Chrome 85.0.4183.102
- Operating System: Windows
Additional context
Enable "Use Real Name" option on Layout -> User interface
Relevant logs:
I20200915-18:48:07.978(0) Exception while invoking method 'loadHistory' TypeError: Cannot destructure property 'username' of '_ref' as it is null. at app/utils/server/lib/normalizeMessagesForUser.js:34:39 at Array.forEach () at app/utils/server/lib/normalizeMessagesForUser.js:34:28 at Array.forEach () at normalizeMessagesForUser (app/utils/server/lib/normalizeMessagesForUser.js:26:11) at loadMessageHistory (app/lib/server/functions/loadMessageHistory.js:31:19) at MethodInvocation.loadHistory (server/methods/loadHistory.js:33:10) at MethodInvocation.methodsMap. (app/lib/server/lib/debug.js:67:34) at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1771:12) at packages/ddp-server/livedata_server.js:719:19 at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js🔢12) at packages/ddp-server/livedata_server.js:717:46 at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js🔢12) at packages/ddp-server/livedata_server.js:715:46 at new Promise () at Session.method (packages/ddp-server/livedata_server.js:689:23) at packages/ddp-server/livedata_server.js:559:43
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with app/utils/server/lib/normalizeMessagesForUser.js at line 34, then trace its caller in app/lib/server/functions/loadMessageHistory.js and server/methods/loadHistory.js. Reproduce the Slack channel import with Use Real Name enabled and confirm that opening a channel with many messages no longer returns a 500 error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100