@node-red/runtime
Advanced tools
Comparing version 3.1.0-beta.2 to 3.1.0-beta.3
@@ -609,6 +609,32 @@ /** | ||
} else { | ||
this.statusNodes.forEach(function(targetStatusNode) { | ||
if (targetStatusNode.scope && targetStatusNode.scope.indexOf(reportingNode.id) === -1) { | ||
const candidateNodes = []; | ||
this.statusNodes.forEach(targetStatusNode => { | ||
if (targetStatusNode.g && targetStatusNode.scope === 'group' && !reportingNode.g) { | ||
// Status node inside a group, reporting node not in a group - skip it | ||
return | ||
} | ||
if (Array.isArray(targetStatusNode.scope) && targetStatusNode.scope.indexOf(reportingNode.id) === -1) { | ||
return; | ||
} | ||
let distance = 0 | ||
if (reportingNode.g) { | ||
// Reporting node inside a group. Calculate the distance between it and the status node | ||
let containingGroup = this.global.groups[reportingNode.g] | ||
while (containingGroup && containingGroup.id !== targetStatusNode.g) { | ||
distance++ | ||
containingGroup = this.global.groups[containingGroup.g] | ||
} | ||
if (!containingGroup && targetStatusNode.g && targetStatusNode.scope === 'group') { | ||
// This status node is in a group, but not in the same hierachy | ||
// the reporting node is in | ||
return | ||
} | ||
} | ||
candidateNodes.push({ d: distance, n: targetStatusNode }) | ||
}) | ||
candidateNodes.sort((A,B) => { | ||
return A.d - B.d | ||
}) | ||
candidateNodes.forEach(candidate => { | ||
const targetStatusNode = candidate.n | ||
var message = { | ||
@@ -671,17 +697,42 @@ status: clone(statusMessage) | ||
} else { | ||
var handledByUncaught = false; | ||
this.catchNodes.forEach(function(targetCatchNode) { | ||
if (targetCatchNode.scope && targetCatchNode.scope.indexOf(reportingNode.id) === -1) { | ||
const candidateNodes = []; | ||
this.catchNodes.forEach(targetCatchNode => { | ||
if (targetCatchNode.g && targetCatchNode.scope === 'group' && !reportingNode.g) { | ||
// Catch node inside a group, reporting node not in a group - skip it | ||
return | ||
} | ||
if (Array.isArray(targetCatchNode.scope) && targetCatchNode.scope.indexOf(reportingNode.id) === -1) { | ||
// Catch node has a scope set and it doesn't include the reporting node | ||
return; | ||
} | ||
if (!targetCatchNode.scope && targetCatchNode.uncaught && !handledByUncaught) { | ||
let distance = 0 | ||
if (reportingNode.g) { | ||
// Reporting node inside a group. Calculate the distance between it and the catch node | ||
let containingGroup = this.global.groups[reportingNode.g] | ||
while (containingGroup && containingGroup.id !== targetCatchNode.g) { | ||
distance++ | ||
containingGroup = this.global.groups[containingGroup.g] | ||
} | ||
if (!containingGroup && targetCatchNode.g && targetCatchNode.scope === 'group') { | ||
// This catch node is in a group, but not in the same hierachy | ||
// the reporting node is in | ||
return | ||
} | ||
} | ||
candidateNodes.push({ d: distance, n: targetCatchNode }) | ||
}) | ||
candidateNodes.sort((A,B) => { | ||
return A.d - B.d | ||
}) | ||
let handledByUncaught = false | ||
candidateNodes.forEach(candidate => { | ||
const targetCatchNode = candidate.n | ||
if (targetCatchNode.uncaught && !handledByUncaught) { | ||
// This node only wants errors that haven't already been handled | ||
if (handled) { | ||
// This has been handled by a !uncaught catch node | ||
return; | ||
return | ||
} | ||
// This is an uncaught error | ||
handledByUncaught = true; | ||
handledByUncaught = true | ||
} | ||
var errorMessage; | ||
let errorMessage; | ||
if (msg) { | ||
@@ -688,0 +739,0 @@ errorMessage = redUtil.cloneMessage(msg); |
@@ -204,3 +204,5 @@ /** | ||
n.subflow = subflowType; | ||
flow.subflows[subflowType].instances.push(n) | ||
if (flow.subflows[subflowType]) { | ||
flow.subflows[subflowType].instances.push(n) | ||
} | ||
} | ||
@@ -207,0 +209,0 @@ if (container) { |
@@ -92,3 +92,12 @@ /*! | ||
adminApp = express(); | ||
const defaultServerSettings = { | ||
"x-powered-by": false | ||
} | ||
const serverSettings = Object.assign({},defaultServerSettings,userSettings.httpServerOptions||{}); | ||
for (let eOption in serverSettings) { | ||
nodeApp.set(eOption, serverSettings[eOption]); | ||
adminApp.set(eOption, serverSettings[eOption]); | ||
} | ||
if (_adminApi) { | ||
@@ -95,0 +104,0 @@ adminApi = _adminApi; |
{ | ||
"name": "@node-red/runtime", | ||
"version": "3.1.0-beta.2", | ||
"version": "3.1.0-beta.3", | ||
"license": "Apache-2.0", | ||
@@ -19,10 +19,10 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"@node-red/registry": "3.1.0-beta.2", | ||
"@node-red/util": "3.1.0-beta.2", | ||
"@node-red/registry": "3.1.0-beta.3", | ||
"@node-red/util": "3.1.0-beta.3", | ||
"async-mutex": "0.4.0", | ||
"clone": "2.1.2", | ||
"express": "4.18.2", | ||
"fs-extra": "10.1.0", | ||
"fs-extra": "11.1.1", | ||
"json-stringify-safe": "5.0.1" | ||
} | ||
} |
596958
13757
+ Added@node-red/registry@3.1.0-beta.3(transitive)
+ Added@node-red/util@3.1.0-beta.3(transitive)
+ Addedfs-extra@11.1.1(transitive)
+ Addedmoment-timezone@0.5.43(transitive)
+ Addedsemver@7.5.0(transitive)
- Removed@node-red/registry@3.1.0-beta.2(transitive)
- Removed@node-red/util@3.1.0-beta.2(transitive)
- Removedfs-extra@10.1.0(transitive)
- Removedmoment-timezone@0.5.41(transitive)
- Removedsemver@7.3.8(transitive)
Updated@node-red/util@3.1.0-beta.3
Updatedfs-extra@11.1.1