RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.24k stars 10.43k forks source link

[BUG] Slash Commands only show 50 (increase limit or delete default slash commands?) #27200

Open Cauen opened 1 year ago

Cauen commented 1 year ago

I’ve created a Rocketchat app that includes ~45 new Slash Commands But, on the frontend, the result is limited at 50… There are ~25 default slash commands that we dont use… There is a way to increase the size of result or delete all default slash commands?

Note: new requests to fetch new commands are not sent as we type different commands

Server Setup Information Version of Rocket.Chat Server: 5.1.3 Operating System: Ubuntu Deployment Method: Docker NodeJS Version: v14.19.3 MongoDB Version: 4.4.15 Proxy: traefik

dudanogueira commented 1 year ago

Hi there, @Cauen !!

The commands list comes from this endpoint, which leads to this lines in codebase:

https://github.com/RocketChat/Rocket.Chat/blob/3f5254d8a7a42f86bef9e945014d5c0dd3720c34/apps/meteor/app/api/server/v1/commands.ts#L138-L143

If you go down the path of searching for the getPaginationItems method, you will find this line:

https://github.com/RocketChat/Rocket.Chat/blob/f0c37c5a8c904181577b80d239255284ac6a1280/apps/meteor/app/api/server/helpers/getPaginationItems.ts#L7-L9

which leads us to conclude that there is a setting for this default value: API_Default_Count

now, if you go to Admin > Settings, and search for this setting, you will get to here: image

And finally here, where you can change this setting: image

Let me know if this helps and if we can close this issue.

Also, check our Community Resources on how and where to ask for help.

Thanks!

Cauen commented 1 year ago

Thanks @dudanogueira It helped me

I wonder if never loading the commands beyond that limit would be the expected behavior What do you think?

Anyway, I believe my case is a special case. Feel free to close the issue

dudanogueira commented 1 year ago

The thing is: that command list API request is obeying that limiting setting.

And it shouldn't. It should iterate and get all items in all command item pages.

I think we can keep this open and maybe go for a fix on that.

Otherwise workspaces with 50+ commands will be broken with default settings.