RocketChat / RocketChat/Rocket.Chat

Outbound integration channel_id incorrect

Open
#22,477 1 comment 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:

Outbound integration requests for messages sent in direct chats contain an unusable channel_id.

Steps to reproduce:
  1. Enable an outbound integration for all_direct_messages.
  2. Send a message in a direct chat
  3. Observe the payload sent by the integration - esp. the channel_id parameter. Example:
{ "bot":false, "channel_id": "97wAfJEuMGc5iDPZ2vrByxjuPoWLJS8EaB", "user_id": "97wAfJEuMGc5iDPZ2", "user_name": "mossy", "text": "Hiya" }
  1. Attempt to use the channel_id from this payload in another API call, such as /api/v1/channels.members?roomId=97wAfJEuMGc5iDPZ2vrByxjuPoWLJS8EaB. The room ID is reported as invalid.
    Example:
{
    "success": false,
    "error": "The required \"roomId\" or \"roomName\" param provided does not match any channel [error-room-not-found]",
    "errorType": "error-room-not-found"
}
Expected behavior:

The channel_id from the webhook payload should be usable to retrieve the channel of the direct chat message.

Actual behavior:

The channel_id is invalid.

Server Setup Information:
  • Version of Rocket.Chat Server: 3.15.0
  • Operating System: Whatever the docker image uses, the host is Arch Linux
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: enabled (I don't know what this means)
  • NodeJS Version: v12.22.1
  • MongoDB Version: 4.0.25 / mmapv1 (oplog Enabled)
Client Setup Information
  • Desktop App or Browser Version: API issue
  • Operating System: Arch Linux
Additional context
Relevant logs:
Exception while invoking method getRoomByTypeAndName Error: Invalid room [error-invalid-room]     at MethodInvocation.getRoomByTypeAndName (server/publications/room/index.js:51:10)     at MethodInvocation.methodsMap.<computed> (app/lib/server/lib/debug.js:76:34)     at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1771:12)     at packages/ddp-server/livedata_server.js:1689:15     at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)     at packages/ddp-server/livedata_server.js:1687:36     at new Promise (<anonymous>)     at Server.applyAsync (packages/ddp-server/livedata_server.js:1686:12)     at Server.apply (packages/ddp-server/livedata_server.js:1625:26)     at Server.call (packages/ddp-server/livedata_server.js:1607:17)     at Object.post (app/api/server/v1/misc.js:263:26)     at app/api/server/api.js:394:82     at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)     at Object._internalRouteActionHandler [as action] (app/api/server/api.js:394:39)     at Route.share.Route.Route._callEndpoint (packages/nimble_restivus/lib/route.coffee:150:32)     at packages/nimble_restivus/lib/route.coffee:59:33     at packages/simple_json-routes.js:98:9  => awaited here:     at Promise.await (/app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:60:12)     at Server.apply (packages/ddp-server/livedata_server.js:1638:22)     at Server.call (packages/ddp-server/livedata_server.js:1607:17)     at Object.post (app/api/server/v1/misc.js:263:26)     at app/api/server/api.js:394:82     at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)     at Object._internalRouteActionHandler [as action] (app/api/server/api.js:394:39)     at Route.share.Route.Route._callEndpoint (packages/nimble_restivus/lib/route.coffee:150:32)     at packages/nimble_restivus/lib/route.coffee:59:33     at packages/simple_json-routes.js:98:9 

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

Reproduce the outbound integration request for a direct-chat message, then trace the channel lookup through the integration payload code and the room/API paths shown in server/publications/room/index.js and app/api/server/v1/misc.js. Done means the emitted channel_id is accepted by channels.members and identifies the direct-chat room.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.