RocketChat / RocketChat/Rocket.Chat
Impossible to remove the leader role from a disabled user
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
If a user is made a leader in a chat, and then their account is disabled, they cannot be removed from the leaders because they are not in the list of chat participants.
In this case, the user's login is fixed in the chat header.
Steps to reproduce:
- Make a user a leader in a channel.
- Disable user account.
- Try to remove the leader role from a disabled user so that their login is not pinned to the top of the chat.
Expected behavior:
I expect one of two behaviors:
- The leader role is automatically removed from users who are disabled.
- The channel owner can see disabled users in the members list and can remove the leader role from them.
Actual behavior:
The disabled user is pinned at the top of the channel, but is not in the list of users.

Server Setup Information:
- Version of Rocket.Chat Server: 6.1.0
- Operating System: CentOS Linux release 7.9.2009
- Deployment Method: docker
- Number of Running Instances: 3
- DB Replicaset Oplog: yes
- NodeJS Version: 14.21.2
- MongoDB Version: 5.0.15
Client Setup Information
- Desktop App or Browser Version: Chrome 108
- Operating System: Windows 10
Additional context
On version 5.4.5 it is also reproduced.
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
The issue names no files, tests, or entry points. Start by reproducing the disabled-user and channel-leader sequence, then trace the handling of channel members and leader roles. Done means a disabled leader can no longer remain pinned without a way for the channel owner to remove the role, with regression coverage for the reported sequence.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- authorization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100