Skip to content

Deactivating only owners breaks the app #24934

Closed

Description

@sidmohanty11

Description:

When a user is the only owner of a channel, and admin chooses to deactivate that specific user in the Administration, then the whole app breaks with an error from server i.e,

{
  "success": false,
  "error": "[user-last-owner]",
  "errorType": "user-last-owner",
  "details": "[object Object]"
}

Steps to reproduce:

  1. If owner is the last person, and tries to leave the channel by Leave option in the sidebar options, it shows us to set an owner before leaving.
  2. But when an admin for example, goes to Admin > Users > Edit User > Deactivate (to that specific user who is the only owner of the channel)
  3. it shows error

Expected behavior:

Should properly handle this scenario

Actual behavior:

Breaks the app

deactivating-user-breaks.mp4

Server Setup Information:

  • Version of Rocket.Chat Server: 4.6.0-develop
  • Operating System: Ubuntu 20.04
  • Deployment Method:
  • Number of Running Instances:
  • DB Replicaset Oplog:
  • NodeJS Version: 14.18.3-x64
  • MongoDB Version:4.4.4

Client Setup Information

  • Desktop App or Browser Version: Brave
  • Operating System: Ubuntu 20.04

Additional context

Thanks @dudanogueira ! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions