Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Users.Info API - Cannot set property 'canViewAllInfo' of undefined #22874

Closed
Fluffy- opened this issue Aug 5, 2021 · 5 comments · Fixed by #23372
Closed

Users.Info API - Cannot set property 'canViewAllInfo' of undefined #22874

Fluffy- opened this issue Aug 5, 2021 · 5 comments · Fixed by #23372

Comments

@Fluffy-
Copy link

Fluffy- commented Aug 5, 2021

Description:

We're getting an error when calling the users.info api when searching for a user that does not exist:
" Cannot set property 'canViewAllInfo' of undefined "

Steps to reproduce:

Call /api/v1/users.info and pass-in username that does not exist

Expected behavior:

Expecting "User not found." response. (as found in older RC versions)

Actual behavior:

Receive the following json response:

{
"success":false,
"error":"Cannot set property 'canViewAllInfo' of undefined"
}

Server Setup Information:

  • Version of Rocket.Chat Server: 3.16.3 / 3.17
  • Operating System: Linux
  • Deployment Method: Docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: NA
  • NodeJS Version: NA
  • MongoDB Version: NA

Client Setup Information

  • Desktop App or Browser Version: All / NA
  • Operating System: All / NA

Additional context

NA

Relevant logs:

API ➔ debug get users.info threw an error: TypeError: Cannot set property 'canViewAllInfo' of undefined at getFullUserDataByIdOrUsername (app/lib/server/functions/getFullUserData.js:95:2) at Object.get (app/api/server/v1/users.js:197:16) at app/api/server/api.js:394:82 at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12) at Object._internalRouteActionHandler [as action] (app/api/server/api.js:394:39) at Route.share.Route.Route._callEndpoint (packages/nimble_restivus/lib/route.coffee:150:32) at packages/nimble_restivus/lib/route.coffee:59:33 at packages/simple_json-routes.js:98:9

Fluffy- added a commit to Fluffy-/Rocket.Chat that referenced this issue Aug 5, 2021
Fixes RocketChat#22874 

We're getting an error ( Cannot set property 'canViewAllInfo' of undefined ) when calling the /api/v1/users.info endpoint when searching for a user that does not exist.

Cannot set property 'canViewAllInfo' of undefined users.info
@debdutdeb
Copy link
Member

James 👋

Thanks for reporting this!

As for the PR, I'll take a look at it soon. If everything checks out, I'll talk to our engineering manager 🙂

@beloniki
Copy link

I see the same message after user deletion within the admin panel.
image

@debdutdeb
Copy link
Member

Hi

I totally forgot about this. Just looked at the PR and looks good. I'll talk to one of our engineers and see when we can get it merged. Thanks Fluffy :)

@debdutdeb
Copy link
Member

debdutdeb commented Aug 30, 2021

Update: we're currently on freeze. The PR can be merged after 3.18 is released :)

@dougfabris
Copy link
Member

@Fluffy- Thanks for reporting!
@debdutdeb The issue was fixed in this PR: #22874

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants