mabunixda / node-red-contrib-nuki

node for nuki
MIT License
6 stars 9 forks source link

please do not create a new msg object when handling messages #21

Closed kapet closed 3 years ago

kapet commented 3 years ago

https://nodered.org/docs/creating-nodes/node-js#sending-messages recommends to re-use incoming message objects and not re-create them.

Currently this node does not do that and instead creates new objects, look for "msg =" in nuki.js

I noticed this when trying to implement a retry logic by adding a counter to the message object and not finding it any more after the message went through the nuki node :-)

kapet commented 3 years ago

works for me now, thanks!