RocketChat / RocketChat/Rocket.Chat
rooms.media API endpoint only upload file but does not send message
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 rooms.media API endpoint does not send a message, but only uploads the file to the channel. Unlike rooms.upload, which does send a message but will be obsolete in version 8.0.0.
Steps to reproduce:
- Call rooms.media endpoint with a bot
curl -s --request POST \
--url "https://<server>/api/v1/rooms.media/<rid>" \
--header "X-User-Id: <X-User-Id>" \
--header "X-Auth-Token: <X-Auth-Token>" \
-F "file=@<filename>;type=text/plain" \
-F "msg=foo"
- Open the channel page. You'll see the file in
...>Filesbut not the message in the feed.
Expected behavior:
A message sended with a notification like rooms.upload endpoint.
Actual behavior:
The file is uploaded but no message are sent.
Server Setup Information:
- Version of Rocket.Chat Server: 7.0.0
- Number of Users: 100
- Deployment Method: Docker
- NodeJS Version: 20.18.1
- MongoDB Version: 7.0.15
Client Setup Information
- Desktop App or Browser Version: 4.1.2 (desktop)
- Operating System: MacOS
Additional context
I noticed in the code that for the rooms.media route there is no message sending, unlike the rooms.upload route.
Task: DOCS-1311
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 in apps/meteor/app/api/server/v1/rooms.ts at the rooms.media route and compare it with the rooms.upload route linked in the issue. Reproduce the upload with the provided curl request, then verify that rooms.media produces a message and notification in the channel feed as well as the uploaded file.
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
- Clearly specified
- Newbie friendliness
- 48/100