From f77dd06e65995471eca9a6a00cf99e701ae8c017 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 13 Mar 2015 17:54:58 +0000 Subject: [PATCH] Partial deploy with missing type breaks flow diff Another refactor of Flow lifecycle. - diffFlow made a private static function - applyConfig now diffConfig - which returns a diff object that can be passed to .stop/.start to be properly applied --- red/nodes/Flow.js | 26 +- red/nodes/flows.js | 2 +- test/red/nodes/Flow_spec.js | 1186 ++++++++++++++++++++++++----------- 3 files changed, 844 insertions(+), 370 deletions(-) diff --git a/red/nodes/Flow.js b/red/nodes/Flow.js index 91fe5260b..b5493c130 100644 --- a/red/nodes/Flow.js +++ b/red/nodes/Flow.js @@ -160,7 +160,7 @@ function createSubflow(sf,sfn,subflows) { if (!node._originalWires) { node._originalWires = clone(node.wires); } - node.wires[wires[j].port] = node.wires[wires[j].port].concat(sfn.wires[i]); + node.wires[wires[j].port] = (node.wires[wires[j].port]||[]).concat(sfn.wires[i]); } } } @@ -353,10 +353,10 @@ Flow.prototype.parseConfig = function(config) { Flow.prototype.start = function(configDiff) { if (configDiff) { - for (var i=0;i