From 1d4a435f202e241ee0ea2b3c8f61d4583961e23c Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Sun, 28 Jan 2018 21:15:59 +0000 Subject: [PATCH] Use a properly random is for parts.id to close #1583 --- nodes/core/logic/17-split.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nodes/core/logic/17-split.js b/nodes/core/logic/17-split.js index 88a6c3d6f..8cabbb5d0 100644 --- a/nodes/core/logic/17-split.js +++ b/nodes/core/logic/17-split.js @@ -71,7 +71,8 @@ module.exports = function(RED) { if (msg.hasOwnProperty("payload")) { if (msg.hasOwnProperty("parts")) { msg.parts = { parts:msg.parts }; } // push existing parts to a stack else { msg.parts = {}; } - msg.parts.id = msg._msgid; // use the existing _msgid by default. + msg.parts.id = RED.util.generateId(); // generate a random id + delete msg._msgid; if (typeof msg.payload === "string") { // Split String into array msg.payload = (node.remainder || "") + msg.payload; msg.parts.type = "string"; @@ -628,7 +629,7 @@ module.exports = function(RED) { group.msg = msg; var tcnt = group.targetCount; if (msg.hasOwnProperty("parts")) { tcnt = group.targetCount || msg.parts.count; } - if ((tcnt > 0 && group.currentCount >= tcnt) || msg.hasOwnProperty('complete')) { + if ((tcnt > 0 && group.currentCount >= tcnt) || msg.hasOwnProperty('complete')) { completeSend(partId); } } catch(err) {