From 209c5f337cb51b32a546af3f461c6a4b726321e2 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 24 Jun 2020 10:02:42 +0100 Subject: [PATCH] Join node - clear timeout when msg.reset received Fixes #2471 --- .../@node-red/nodes/core/sequence/17-split.js | 12 ++++++++++-- 1 file changed, 10 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 ced637555..3f774d68c 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 @@ -446,7 +446,7 @@ module.exports = function(RED) { buffers.push(joinBuffer); bufferLen += joinBuffer.length; } - if (!Buffer.isBuffer(group.payload[i])) { + if (!Buffer.isBuffer(group.payload[i])) { group.payload[i] = Buffer.from(group.payload[i]); } buffers.push(group.payload[i]); @@ -573,7 +573,15 @@ module.exports = function(RED) { } } - if (msg.hasOwnProperty("reset")) { if (inflight[partId]) { delete inflight[partId] }; return; } + if (msg.hasOwnProperty("reset")) { + if (inflight[partId]) { + if (inflight[partId].timeout) { + clearTimeout(inflight[partId].timeout); + } + delete inflight[partId] + } + return + } if ((payloadType === 'object') && (propertyKey === null || propertyKey === undefined || propertyKey === "")) { if (node.mode === "auto") {