Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Quote message from incoming webhook without attachement not possible

Open N4IR0 opened this issue 9 years ago • 1 comments

Description:

Currently it is not possible to quote a message from an incoming webhook without attachements.

Server Setup Information:

  • Version of Rocket.Chat Server: 0.58.2 (also tested in 0.59.0-rc.5)
  • Operating System: Linux Ubuntu 16.04 LTS
  • Deployment Method(snap/docker/tar/etc): Docker
  • Number of Running Instances: 3
  • DB Replicaset Oplog: enabled
  • Node Version: v4.8.4

Steps to Reproduce:

  1. Create an incoming webhook without any script
  2. Send only a message to the webhook: curl -X POST -H 'Content-Type: application/json' --data '{"text":"Example message"}' <Webhook URL>
  3. Try to quote the message from the webhook -> Not working
  4. Send a message with an empty attachement array: curl -X POST -H 'Content-Type: application/json' --data '{"text":"Example message","attachments":[]}' <Webhook URL>
  5. Try to quote the message from the webook -> Working

Expected behavior:

The quotation feature should also work for messages from an incoming webhook without attachement array.

Actual behavior:

The quote is only displayed with a grey text (if a custom text was added, otherwise there is an empty message) and gone after reloading the page.

Relevant logs:

934eefb587bd[18971]: Exception while invoking method 'sendMessage' TypeError: Cannot read property 'map' of null
934eefb587bd[18971]:   at recursiveRemove (/app/bundle/programs/server/packages/rocketchat_oembed.js:547:23)
934eefb587bd[18971]:   at /app/bundle/programs/server/packages/rocketchat_oembed.js:569:27
934eefb587bd[18971]:   at Array.forEach (native)
934eefb587bd[18971]:   at /app/bundle/programs/server/packages/rocketchat_oembed.js:560:12
934eefb587bd[18971]:   at /app/bundle/programs/server/packages/rocketchat_lib.js:316:25
934eefb587bd[18971]:   at Array.reduce (native)
934eefb587bd[18971]:   at Object.RocketChat.callbacks.run (/app/bundle/programs/server/packages/rocketchat_lib.js:309:6)
934eefb587bd[18971]:   at Object.RocketChat.sendMessage (/app/bundle/programs/server/packages/rocketchat_lib.js:3303:33)
934eefb587bd[18971]:   at [object Object].Meteor.methods.sendMessage (/app/bundle/programs/server/packages/rocketchat_lib.js:14473:21)
934eefb587bd[18971]:   at [object Object].methodsMap.(anonymous function) (/app/bundle/programs/server/packages/rocketchat_lib.js:1110:26)
934eefb587bd[18971]:   at [object Object].methodMap.(anonymous function) (packages/rocketchat_monitoring.js:2731:30)
934eefb587bd[18971]:   at maybeAuditArgumentChecks (/app/bundle/programs/server/packages/ddp-server.js:1858:12)
934eefb587bd[18971]:   at /app/bundle/programs/server/packages/ddp-server.js:904:20
934eefb587bd[18971]:   at [object Object]._.extend.withValue (packages/meteor.js:1126:17)
934eefb587bd[18971]:   at /app/bundle/programs/server/packages/ddp-server.js:903:47
934eefb587bd[18971]:   at [object Object]._.extend.withValue (packages/meteor.js:1126:17)
934eefb587bd[18971]:   at /app/bundle/programs/server/packages/ddp-server.js:902:46
934eefb587bd[18971]:   at [object Object]._.extend.protocol_handlers.method (/app/bundle/programs/server/packages/ddp-server.js:875:21)
934eefb587bd[18971]:   at /app/bundle/programs/server/packages/ddp-server.js:754:85

N4IR0 avatar Sep 18 '17 08:09 N4IR0

Hi there, thanks for the contribution! 🚀 💯

Sorry, this error does not happen on the latest and maintained releases.

Rocket.Chat  provides support for, at least, 3 months for each release and 6 months to the latest releases of each major version

I would suggest you update your Rocket.Chat version to the latest stable version, which you can find in Releases Page and, check it HERE the table with versions and End of Life dates.


Questions? Help needed? Feature Requests?

hugocostadev avatar Apr 10 '23 21:04 hugocostadev