GoogleCloudPlatform / node-red-contrib-google-cloud

Node-RED nodes for Google Cloud Platform
Apache License 2.0
90 stars 57 forks source link

PubSub in messages are read-only but aren't being treated as such. #20

Closed kolban-google closed 5 years ago

kolban-google commented 5 years ago

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.

kolban-google commented 5 years ago

Code changes commited to branch dev. Will close issue when published.