madmax3365 / node-red-node-discord

Discord nodes for node-red
6 stars 9 forks source link

Forking node-discord message causes clone crash #1

Open mmattice opened 4 years ago

mmattice commented 4 years ago

What are the steps to reproduce?

with node-red-node-discord@2.1.0

Screen Shot 2019-12-10 at 9 34 16 PM

What happens?

Apparently taking the output of this discord message handler and forking it into two debugs gives this error. If I kill one of the links, I don't get the error.

11 Dec 05:30:57 - [red] Uncaught Exception:
11 Dec 05:30:57 - TypeError: Cannot assign to read only property 'writeQueueSize' of object '#<TCP>'
    at _clone (/usr/src/node-red/node_modules/clone/clone.js:162:16)
    at _clone (/usr/src/node-red/node_modules/clone/clone.js:162:18)
    at _clone (/usr/src/node-red/node_modules/clone/clone.js:162:18)
    at _clone (/usr/src/node-red/node_modules/clone/clone.js:162:18)
    at _clone (/usr/src/node-red/node_modules/clone/clone.js:162:18)
    at _clone (/usr/src/node-red/node_modules/clone/clone.js:162:18)
    at _clone (/usr/src/node-red/node_modules/clone/clone.js:162:18)
    at _clone (/usr/src/node-red/node_modules/clone/clone.js:162:18)
    at _clone (/usr/src/node-red/node_modules/clone/clone.js:162:18)
    at _clone (/usr/src/node-red/node_modules/clone/clone.js:162:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-red-docker@1.0.3 start: `node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"`
npm ERR! Exit status 1

What do you expect to happen?

I expect the message to be cloned without issue, or at least a non-fatal one.

Please tell us about your environment:

madmax3365 commented 4 years ago

Hi. Thank you for your feedback, and sorry for the delay. As I can see error comes from node-red core clone function. I think the problem is that the discord node sends a too complex object to msg, so the clone fails. Going to check tomorrow :) As a workaround, you can filter discord output with function node leaving only necessary properties until I'll have time to add property filtering functionality in the node.