RocketChat / RocketChat/Rocket.Chat

Integrations: Incoming Webhook - Super globals not working

Open
#28,973 0 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:

After upgrading Rocket.Chat from 4.8.3 to 6.1.3 our Webhook Script did not work anymore. Before upgrading the Webhook script was working as expected.

Steps to reproduce:
  1. Go to Integration Webhooks
  2. Create a Webhook
  3. Insert a script, which is using the super global s:
let text = 'my funny demo text without any sence';
text=s(text).replaceAll(' ','_').strLeft('text').value();
  1. Curl the webhook
Expected behavior:

Push the notification to the chat room!

Actual behavior:

Nothing happens
Rocket.Chat container logs:

... long message ... ,"msg":"TypeError: s is not a function"}
Server Setup Information:
  • Version of Rocket.Chat Server: 6.1.3
  • Operating System: Ubuntu 20
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: 12.21.2
  • MongoDB Version: 4.4.10
Workaround:

I am currently not using the super global s anymore.

Possible solutions:

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 with the Integration Webhooks flow described in the issue and reproduce the script using the super global s against the reported versions. Compare the webhook behavior with the earlier working version and inspect the documentation at the linked Integrations page. Done means either restoring the expected notification behavior or documenting the supported replacement if s is intentionally unavailable.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.