Renaming user results in incorrect usernames in RocketChat.models.Rooms
Description:
Renaming a user doesn't get reflected properly in RocketChat.models.Rooms
Server Setup Information:
- Version of Rocket.Chat Server: 0.59.4
- Operating System: Windows 10
- Deployment Method(snap/docker/tar/etc): meteor via Windows command shell
- Number of Running Instances: 1
- Node Version: 8.5.0
Steps to Reproduce:
- I have a DM between 2 users: jekyll and gabriel, which I can view via
meteor shell:
> RocketChat.models.Rooms.findOneById('HR4L8iaJAQgJCsJa2oqH54pehs5pAopoeQ')
{ _id: 'HR4L8iaJAQgJCsJa2oqH54pehs5pAopoeQ', // deleted stuff usernames: [ 'jekyll', 'gabriel' ], <-- as expected username: 'jekyll' }
- If I rename jekyll's username to hyde via /admin/profile, I then see:
{ _id: 'HR4L8iaJAQgJCsJa2oqH54pehs5pAopoeQ', // deleted stuff usernames: [ 'jekyll', 'hyde' ], <-- why is jekyll still here, and not gabriel? username: 'gabriel' }
Expected behavior:
I would expect to see usernames: ['gabriel', 'hyde'] after the rename has occurred
Actual behavior:
The original username is still stored, which then causes room.usernames.indexOf(user.username) in getRoomIdByNameOrId to return -1 when gabriel tries to send a message to the newly-renamed hyde
@garychapman I wasn't able to reproduce your but, are you able to reproduce it consistently?
How many users and rooms do you have in your instance?
Did you go to account/profile or admin/users to edit the user's data?
Was any progress made on this? I am definitely still seeing the issue. When changing the user's name from the admin/users page, it breaks the rooms. Anyone who has previously been in a room with them gets an error when trying to chat with their new username
Currently using version 0.69.1
@wonkaba please try the last version, I'm confident we fixed :)
@wonkaba please try the last version, I'm confident we fixed :)
Upgraded to 0.74.1 today and this is still an issue.
@garychapman @wonkaba
please I couldnt reproduce here... could you help me ?

We will close this issue until we receive more information to reproduce the problem. Please reopen if it persists.