Skip to content

Conversation

@deepak0x
Copy link
Contributor

@deepak0x deepak0x commented Jan 24, 2026

This PR fixes a 400 Bad Request error encountered when the application attempts to fetch user roles (specifically admin roles).

The previous implementation relied on a legacy Meteor method call (method.call/getUserRoles) via the DDP-over-REST endpoint. This method has been deprecated or removed in modern Rocket.Chat server versions, causing the API to return a 404 Method Not Found error (wrapped inside a 400 response).

This change updates the getUserRoles implementation to use the supported REST API endpoint roles.getUsersInRole, restoring compatibility with modern Rocket.Chat servers.


Closes #1099

Changes

Updated packages/api/src/EmbeddedChatApi.ts:

  • Replaced the legacy getUserRoles() implementation with a call to this.getUsersInRole("admin").

  • Preserved the existing return structure ({ result: [...] }) to maintain backward compatibility with:

    • useFetchChatData
    • memberStore

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: getUserRoles fails with 400/404 on modern Rocket.Chat versions

1 participant