From 31b17faa2ade0e8a22b588ae29ae6c86e6eac0e8 Mon Sep 17 00:00:00 2001 From: Steve-Mcl Date: Fri, 12 Aug 2022 18:23:07 +0100 Subject: [PATCH] fix MQTT test fail due to birth sent before connection done --- packages/node_modules/@node-red/nodes/core/network/10-mqtt.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/node_modules/@node-red/nodes/core/network/10-mqtt.js b/packages/node_modules/@node-red/nodes/core/network/10-mqtt.js index dccf1310b..50b1d690f 100644 --- a/packages/node_modules/@node-red/nodes/core/network/10-mqtt.js +++ b/packages/node_modules/@node-red/nodes/core/network/10-mqtt.js @@ -786,7 +786,9 @@ module.exports = function(RED) { // Send any birth message if (node.birthMessage) { - node.publish(node.birthMessage); + setTimeout(() => { + node.publish(node.birthMessage); + }, 1); } }); node._clientOn("reconnect", function() {