diff --git a/nodes/core/logic/17-split.html b/nodes/core/logic/17-split.html index 5d1e6e6dd..fccb8c0d0 100644 --- a/nodes/core/logic/17-split.html +++ b/nodes/core/logic/17-split.html @@ -295,7 +295,8 @@ For object outputs, once this count has been reached, the node can be configured to send a message for each subsequent message received.
A timeout can be set to trigger sending the new message using whatever has been received so far.
-If a message is received with the msg.complete property set, the output message is sent.
+If a message is received with the msg.complete property set, the output message is finalised and sent. + This resets any part counts.
When configured to join in reduce mode, an expression is applied to each diff --git a/nodes/core/logic/17-split.js b/nodes/core/logic/17-split.js index 3170ba584..f5ad199ca 100644 --- a/nodes/core/logic/17-split.js +++ b/nodes/core/logic/17-split.js @@ -586,7 +586,10 @@ module.exports = function(RED) { } else { if (msg.hasOwnProperty('complete')) { - completeSend(partId); + if (inflight[partId]) { + inflight[partId].msg.complete = msg.complete; + completeSend(partId); + } } else { node.warn("Message missing key property 'msg."+node.key+"' - cannot add to object") @@ -594,6 +597,7 @@ module.exports = function(RED) { } return; } + if (!inflight.hasOwnProperty(partId)) { if (payloadType === 'object' || payloadType === 'merged') { inflight[partId] = { @@ -604,19 +608,6 @@ module.exports = function(RED) { msg:RED.util.cloneMessage(msg) }; } - else if (node.accumulate === true) { - if (msg.hasOwnProperty("reset")) { delete inflight[partId]; } - inflight[partId] = inflight[partId] || { - currentCount:0, - payload:{}, - targetCount:targetCount, - type:payloadType, - msg:RED.util.cloneMessage(msg) - } - if (payloadType === 'string' || payloadType === 'array' || payloadType === 'buffer') { - inflight[partId].payload = []; - } - } else { inflight[partId] = { currentCount:0,