RocketChat / RocketChat/Rocket.Chat

Overriding the target channel in an outgoing webhook does not work unless the target channel is the user that owns the webhook

Open
#29,400 1 comment 1 reaction 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:

I have an outgoing webhook that is supposed to react on triggers in a public channel and post the answer in a direct message. From what I understand, this should be possible to do by setting the channel field in the response to the hook.
However, this doesn't work for all users. It works when channel contains the username of the user that owns the hook, but not for other users

Steps to reproduce:
  1. Create an outgoing webhook that gets triggered on messages, listens on a public channel, and does not have a script. answers should be sent as a (bot) user different to the user that owns the webhook.
  2. In the response to a trigger, set the channel to a user that exists, and is not the owner of the webhook
Expected behavior:

I'd expect the message to appear as a direct message to the user according to the channel field in the response to the webhook.

Actual behavior:

From what I see, nothing happens. There's no message, and nothing in the logs. It works, when the channel field is not set (the response appears in the channel the hook was triggered from), or if the channel contains the username of the webhook owner.

Server Setup Information:
  • Version of Rocket.Chat Server: 6.2.1
Client Setup Information

The behavior is consistent across different clients and operating systems

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

No files, tests, or entry points are named. Start by reproducing the webhook response with a non-owner user in the channel field, then trace the outgoing webhook handling. Done means the response posts a direct message to the specified user and existing behavior remains intact when the field is omitted or targets the owner.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.