martin-doyle / node-red-contrib-aedes

MQTT broker for Node-RED based on Aedes
MIT License
62 stars 11 forks source link

payload topic undefined #78

Open dsl400 opened 5 months ago

dsl400 commented 5 months ago

my humble oppinnion is that subscription is deleted before the node.send finishes

 broker.on('subscribe', function (subscription, client) {
      console.log(subscription) >>>>>> [{ topic: 'db/client-ek2jasyss8r/repo/7c8c7f0e-1b4d-4822-9f95-52a6a079a3e6',qos: 1 }]
      const msg = {
        topic: 'subscribe',
        payload: {
          topic: subscription.topic,
          qos: subscription.qos,
          client
        }
      };
      node.send([msg, null]);
    });

image

dsl400 commented 5 months ago

AHEM! ..... my humble opinion was wrong ....

subscription is of type array :D

image

image