From 468cfeffb6758d0397a3e6e5ca86f9eed27c115f Mon Sep 17 00:00:00 2001 From: martinb Date: Tue, 3 Nov 2020 09:35:21 +0100 Subject: [PATCH] make split node work with out of order messages as long as one of the messages has msg.parts.count set to the proper value --- .../node_modules/@node-red/nodes/core/sequence/17-split.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/node_modules/@node-red/nodes/core/sequence/17-split.js b/packages/node_modules/@node-red/nodes/core/sequence/17-split.js index 3f774d68c..fbbae8048 100644 --- a/packages/node_modules/@node-red/nodes/core/sequence/17-split.js +++ b/packages/node_modules/@node-red/nodes/core/sequence/17-split.js @@ -677,7 +677,10 @@ module.exports = function(RED) { } group.msg = Object.assign(group.msg, msg); var tcnt = group.targetCount; - if (msg.hasOwnProperty("parts")) { tcnt = group.targetCount || msg.parts.count; } + if (msg.hasOwnProperty("parts")) { + tcnt = group.targetCount || msg.parts.count; + group.targetCount = tcnt; + } if ((tcnt > 0 && group.currentCount >= tcnt) || msg.hasOwnProperty('complete')) { completeSend(partId); } @@ -697,3 +700,4 @@ module.exports = function(RED) { } RED.nodes.registerType("join",JoinNode); } +