With the PubSub In node, we are being triggered when a new message is published to a topic. We are being passed a Message object and going forth from there. We are currently passing the receives message as the Node-RED msg.payload which means that it is fair game for downstream nodes to "fiddle" with the content. That must NOT be allowed. Our initial thinking is that we will change the semantics of the node.
When a new message is received, we will place that message at:
msg.message and document it as being read-only.
We will place the data payload of the received message at msg.payload which should be fine as it will be a Buffer and immutable.
With the PubSub In node, we are being triggered when a new message is published to a topic. We are being passed a Message object and going forth from there. We are currently passing the receives message as the Node-RED
msg.payload
which means that it is fair game for downstream nodes to "fiddle" with the content. That must NOT be allowed. Our initial thinking is that we will change the semantics of the node.When a new message is received, we will place that message at:
msg.message
and document it as being read-only.We will place the data payload of the received message at
msg.payload
which should be fine as it will be a Buffer and immutable.This will be a semantic change on the node.