mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Fix join node reset issue with merging objects
and add tests to close #2188
This commit is contained in:
@@ -572,6 +572,8 @@ module.exports = function(RED) {
|
||||
}
|
||||
}
|
||||
|
||||
if (msg.hasOwnProperty("reset")) { if (inflight[partId]) { delete inflight[partId] }; return; }
|
||||
|
||||
if ((payloadType === 'object') && (propertyKey === null || propertyKey === undefined || propertyKey === "")) {
|
||||
if (node.mode === "auto") {
|
||||
node.warn("Message missing 'msg.parts.key' property - cannot add to object");
|
||||
@@ -590,7 +592,6 @@ module.exports = function(RED) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (msg.hasOwnProperty("reset")) { if (inflight[partid]) { delete inflight[partId] } return; }
|
||||
if (!inflight.hasOwnProperty(partId)) {
|
||||
if (payloadType === 'object' || payloadType === 'merged') {
|
||||
inflight[partId] = {
|
||||
@@ -631,7 +632,7 @@ module.exports = function(RED) {
|
||||
}
|
||||
if (payloadType === 'object') {
|
||||
group.payload[propertyKey] = property;
|
||||
group.currentCount = (group.currentCount || 0) + 1;
|
||||
group.currentCount = Object.keys(group.payload).length;
|
||||
} else if (payloadType === 'merged') {
|
||||
if (Array.isArray(property) || typeof property !== 'object') {
|
||||
if (!msg.hasOwnProperty("complete")) {
|
||||
|
Reference in New Issue
Block a user