RocketChat / RocketChat/Rocket.Chat
Integrations: Incoming Webhook - Super globals not working
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:
- Go to Integration Webhooks
- Create a Webhook
- 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();
- 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:
- Fix it in a way the super global work as in does earlier versions of RC
- Remove its usage from documentation: https://docs.rocket.chat/use-rocket.chat/workspace-administration/integrations
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 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