Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Renaming user results in incorrect usernames in RocketChat.models.Rooms

Open garychapman opened this issue 8 years ago • 6 comments

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:

  1. 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' }

  1. 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 avatar Dec 18 '17 07:12 garychapman

@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?

rodrigok avatar Dec 18 '17 18:12 rodrigok

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 avatar Feb 01 '19 19:02 wonkaba

@wonkaba please try the last version, I'm confident we fixed :)

ggazzo avatar Feb 05 '19 15:02 ggazzo

@wonkaba please try the last version, I'm confident we fixed :)

Upgraded to 0.74.1 today and this is still an issue.

wonkaba avatar Feb 06 '19 23:02 wonkaba

@garychapman @wonkaba please I couldnt reproduce here... could you help me ? ezgif-2-15a821a0daa6

ggazzo avatar Mar 12 '19 16:03 ggazzo

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

engelgabriel avatar Apr 06 '19 07:04 engelgabriel