RocketChat / RocketChat/Rocket.Chat

Timeout when editing user info

Open
#8,176 1 comment 0 reactions 1 assignee View on GitHub

@brunosquadros is already working on this.

Since Dec 19, 2019.

feat: app settings triaged type: improvement
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

There are three methods that throw a one minute timeout when trying to edit some user information.
All three are timing out via rest api calls, and setUsername also times out in admin web interface.

There is a check for the timeout function that, in my understanding, should not trigger the timeout if the user who makes the editing has 'edit-other-user-info' privilege, which doesn't seem to work.
I assume it probably has something to do with RocketChat.authz.hasPermission() function/alias, because, for one, I can't access it from browser console.

Operations that result in timeout are:
change name - packages/rocketchat-lib/server/functions/setRealName.js
change email - packages/rocketchat-lib/server/functions/setEmail.js
Here the check is realized like this:
{ 0() { return !Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'edit-other-user-info'); }

change username - packages/rocketchat-lib/server/functions/setUsername.js
In this one the check slightly differs:
{ [0](userId) { return !userId || !RocketChat.authz.hasPermission(userId, 'edit-other-user-info'); }

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.