Fix join node to ignore parts in manual mode

to fix #1957
This commit is contained in:
Dave Conway-Jones 2023-11-01 13:59:09 +00:00
parent 08c6ea94cb
commit 10ce681d46
No known key found for this signature in database
GPG Key ID: 1DDB0E91A28C2643

View File

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