chameleonbr / node-red-contrib-redis

Node RED client for Redis with pub/sub, list, lua scripting and other commands support.
MIT License
46 stars 42 forks source link

Incomming topic is overwriting the topic set in the node #46

Closed qwaxys closed 4 years ago

qwaxys commented 4 years ago

https://github.com/chameleonbr/node-red-contrib-redis/blob/1193796700f5874c8e33e51ea4f3f26bcf529b37/redis.js#L161

The incoming/msg topic is overwriting the topic set in the node.

Should this: if (msg.topic !== undefined && msg.topic !== "") { not be: if (msg.topic !== undefined && msg.topic == "") { ?

chameleonbr commented 4 years ago

The default topic is configured in node, if you need change topic fill in msg.topic and the "default topic" is overrided, if you need ever keep the default topic, only clean msg.topic before pass the node.