RocketChat / RocketChat/Rocket.Chat

[BUG] API users.list doesn't work as expected

Open
#22,287 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

As in the documentation described as admin one should get all the fields of a user: https://developer.rocket.chat/api/rest-api/methods/users/list, but it just shows some of them.

Steps to reproduce:
  1. API call with Admin User users.list?query={"username":}
Expected behavior:

It should show somthing like this (Documentation):

{ "users": [ { "_id": "nSYqWzZ4GsKTX4dyK", "createdAt": "2016-12-07T15:47:46.861Z", "services": { "password": { "bcrypt": ... }, "email": { "verificationTokens": [ { "token": "...", "address": "example@example.com", "when": "2016-12-07T15:47:46.930Z" } ] }, "resume": { "loginTokens": [ { "when": "2016-12-07T15:47:47.334Z", "hashedToken": "..." } ] } }, "emails": [ { "address": "example@example.com", "verified": true } ], "type": "user", "status": "offline", "active": true, "roles": [ "user" ], "name": "Example User", "lastLogin": "2016-12-08T00:22:15.167Z", "statusConnection": "offline", "utcOffset": 0, "username": "example" }, { ... } ], "count": 3, "offset": 2, "total": 10, "success": true }

Actual behavior:

It actually shows only:

{ "users": [ { "_id": "sfsdgfdsgfdsdg", "username": "test", "emails": [ { "address": "test", "verified": true } ], "status": "offline", "active": true, "roles": [ "user" ], "name": "test", "nameInsensitive": "test" } ], "count": 1, "offset": 0, "total": 1, "success": true }

So the results are really less than expected

Server Setup Information:
  • Version of Rocket.Chat Server: 3.15.0
  • Operating System: Debian
  • Number of Running Instances: 3
  • NodeJS Version: 12.22.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the users.list REST API documentation and reproduce the admin request using the username query shown in the issue. Compare the documented and actual fields, then trace the users.list endpoint to determine the intended response; done means the endpoint behavior and documentation agree without exposing inappropriate fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.