RocketChat / RocketChat/Rocket.Chat

API: Channel Messages cannot be queried using `roomName`

Open
#30,853 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

When using the Channel Messages endpoint using roomName instead of roomId, no messages are returned

Steps to reproduce:
  1. Query https://example.com/api/v1/channels.messages?roomName=general
Expected behavior:

A list of messages

Actual behavior:

The following Body:

{"success":false,"error":"must have required property 'roomId' [invalid-params]","errorType":"invalid-params"}"
Server Setup Information:
  • Version of Rocket.Chat Server: 6.4.4
  • Operating System: Linux
  • Deployment Method: Docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: enabled
  • NodeJS Version: Whatever is in your container images
  • MongoDB Version: 6.0
Client Setup Information
  • Desktop App or Browser Version:
  • Operating System:
Additional context
Relevant logs:
{"level":35,"time":"2023-11-03T16:14:40.713Z","pid":1,"hostname":"rocketchat-79bbdf7455-w95q7","name":"API","method":"GET","url":"/api/v1/channels.messages?roomName=general","userId":"xxx","userAgent":"export_channel/0.1.0 (@xxx)","host":"xxx","remoteIP":"xxx","err":{"type":"errorClass","message":"must have required property 'roomId' [invalid-params]","stack":"Error: must have required property 'roomId' [invalid-params]\n    at app/api/server/api.ts:594:16\n    at /app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40","isClientSafe":true,"error":"invalid-params","reason":"must have required property 'roomId'","errorType":"Meteor.Error"},"status":400,"responseTime":1,"msg":"must have required property 'roomId' [invalid-params]"}

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.

Research direction

Start by reproducing the GET /api/v1/channels.messages request with roomName=general and inspect the Channel Messages endpoint's parameter validation. Confirm that the endpoint accepts roomName as documented and returns the channel's messages, while preserving the existing roomId behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.