1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

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

This commit is contained in:
martinb 2020-11-03 09:35:21 +01:00
parent 280203e64e
commit 468cfeffb6

View File

@ -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);
}