From 10ce681d4629140c3ef272749336b8cc419b6c17 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Wed, 1 Nov 2023 13:59:09 +0000 Subject: [PATCH] Fix join node to ignore parts in manual mode to fix #1957 --- .../@node-red/nodes/core/sequence/17-split.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 10c696b76..dad635dca 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 @@ -298,7 +298,6 @@ module.exports = function(RED) { return exp } - function reduceMessageGroup(node,msgInfos,exp,fixup,count,accumulator,done) { var msgInfo = msgInfos.shift(); exp.assign("I", msgInfo.msg.parts.index); @@ -330,6 +329,7 @@ module.exports = function(RED) { } }); } + function reduceAndSendGroup(node, group, done) { var is_right = node.reduce_right; var flag = is_right ? -1 : 1; @@ -589,7 +589,7 @@ module.exports = function(RED) { } if (node.mode === 'auto' && (!msg.hasOwnProperty("parts")||!msg.parts.hasOwnProperty("id"))) { - // if a blank reset messag erest it all. + // if a blank reset message reset it all. if (msg.hasOwnProperty("reset")) { if (inflight && inflight.hasOwnProperty("partId") && inflight[partId].timeout) { clearTimeout(inflight[partId].timeout); @@ -603,6 +603,15 @@ module.exports = function(RED) { return; } + if (node.mode === 'custom' && msg.hasOwnProperty('parts')) { + if (msg.parts.hasOwnProperty('parts')) { + msg.parts = { parts: msg.parts.parts }; + } + else { + delete msg.parts; + } + } + var payloadType; var propertyKey; var targetCount;