RocketChat / RocketChat/Rocket.Chat
API: rooms.cleanHistory not working
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
The API call does not work in direct chats. When requesting rooms.cleanHistory to clear personal chats, I get the error:
{"success":false,"error":"User does not have access to the room [error-not-allowed]","errorType":"error-not-allowed"}
In version 6.13.0 and earlier, this call worked correctly and allowed deleting user messages in direct chats. I make the request via admin account.
Steps to reproduce:
Call API request to some direct chat room:
curl --request POST
--url https://$site/api/v1/rooms.cleanHistory
--header 'Content-Type: application/json'
--header "X-Auth-Token: $authToken"
--header "X-User-Id: $userId"
Expected behavior:
Successfully cleared the direct chat room.
Actual behavior:
{"success":false,"error":"User does not have access to the room [error-not-allowed]","errorType":"error-not-allowed"}
Server Setup Information:
- Version of Rocket.Chat Server: 7.3.1
- License Type: Community
- Number of Users: 100
- Operating System: Ubuntu 22
- Deployment Method: snap
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the rooms.cleanHistory request against a direct chat using the curl example and compare its behavior with version 6.13.0. Trace the rooms.cleanHistory API entry point and identify why an admin request is rejected; done means direct-chat history is cleared successfully without the error-not-allowed response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100