Repository navigation
Importing flow - backend is not align with UI #5983
Copy link
Copy link
Open
Labels
Description
Current Behavior
There is an bug when importing an flow with Subflows. When you go to the "View nodes..." page and you select the Subflow with the check box on the left then you select the replace button on the right, then you deselect the checkbox on the left the replace checkbox on the right is disabled. Which is good within the UI, but when you click on "Import Selected" it will get imported but if you open the Subflow you see that the link between the nodes in the Subflow are gone.
Expected Behavior
When you deselect the left checkbox even if the replace checkbox is selected the backend should not do any replacement.
Steps To Reproduce
- import this flow (see below)
- Deploy the flow
- Refresh the browser tab (just to be save)
- Import the flow again click on "View nodes..."
- Select the left and right checkbox at the Subflow
- Deselect the left checkbox
- Click on "Import selected"
- Open the Subflow and click on edit.
- You see that some nodes in the Subflow are disconnected.
Example flow
[{"id":"52cf4185bc2f8bf8","type":"subflow","name":"SubTest","info":"","category":"","in":[{"x":80,"y":100,"wires":[{"id":"a95ab484c97013e1"},{"id":"b5171c2d17a36436"}]}],"out":[{"x":460,"y":60,"wires":[{"id":"a95ab484c97013e1","port":0}]},{"x":670,"y":240,"wires":[{"id":"bb9ec93366ec2980","port":0}]}],"env":[{"name":"Equipment","type":"str","value":"sword","ui":{"type":"select","opts":{"opts":[{"l":{"en-US":"Sword"},"v":"sword"},{"l":{"en-US":"Shovel"},"v":"shovel"},{"l":{"en-US":"Hoe"},"v":"hoe"}]}}},{"name":"Type","type":"str","value":"diamond","ui":{"type":"select","opts":{"opts":[{"l":{"en-US":"Diamond"},"v":"diamond"},{"l":{"en-US":"Iron"},"v":"iron"},{"l":{"en-US":"Gold"},"v":"gold"}]}}}],"meta":{"license":"Apache-2.0"},"color":"#DDAA99","inputLabels":["in"],"outputLabels":["out","error"],"icon":"node-red/arrow-in.svg","status":{"x":640,"y":140,"wires":[{"id":"b5171c2d17a36436","port":0},{"id":"bb9ec93366ec2980","port":0},{"id":"f007f0ab9bc92e26","port":0}]}},{"id":"a95ab484c97013e1","type":"function","z":"52cf4185bc2f8bf8","name":"function 26","func":"const sleep = (milliseconds) => {\n return new Promise(resolve => setTimeout(resolve, milliseconds))\n}\n\nawait sleep(2000)\n\n\nmsg.payload = {\n equipment: env.get(\"Equipment\"), type: env.get(\"Type\")\n}\n\nif (env.get(\"Type\") === \"iron\") {\n node.error(\"Error\", {});\n} else {\n return msg;\n}","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":230,"y":60,"wires":[["f007f0ab9bc92e26"]]},{"id":"b5171c2d17a36436","type":"change","z":"52cf4185bc2f8bf8","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.text","pt":"msg","to":"fetching","tot":"str"},{"t":"set","p":"payload.shape","pt":"msg","to":"dot","tot":"str"},{"t":"set","p":"payload.fill","pt":"msg","to":"blue","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":240,"y":140,"wires":[[]]},{"id":"2495b93efd105078","type":"catch","z":"52cf4185bc2f8bf8","name":"","scope":null,"uncaught":false,"x":260,"y":180,"wires":[["bb9ec93366ec2980"]]},{"id":"bb9ec93366ec2980","type":"change","z":"52cf4185bc2f8bf8","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.text","pt":"msg","to":"error","tot":"str"},{"t":"set","p":"payload.shape","pt":"msg","to":"dot","tot":"str"},{"t":"set","p":"payload.fill","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":180,"wires":[[]]},{"id":"f007f0ab9bc92e26","type":"change","z":"52cf4185bc2f8bf8","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.text","pt":"msg","to":"done","tot":"str"},{"t":"set","p":"payload.shape","pt":"msg","to":"dot","tot":"str"},{"t":"set","p":"payload.fill","pt":"msg","to":"green","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":100,"wires":[[]]},{"id":"8cd5b67eba1c9612","type":"tab","label":"test","disabled":false,"info":"","env":[]},{"id":"0ca985cc181d5419","type":"inject","z":"8cd5b67eba1c9612","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":120,"wires":[["225036aa027f5bb6"]]},{"id":"e1386972bf084a0b","type":"debug","z":"8cd5b67eba1c9612","name":"debug 98","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":480,"y":100,"wires":[]},{"id":"cc6a9555e9c3538e","type":"debug","z":"8cd5b67eba1c9612","name":"debug 99","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":480,"y":140,"wires":[]},{"id":"225036aa027f5bb6","type":"subflow:52cf4185bc2f8bf8","z":"8cd5b67eba1c9612","name":"","x":320,"y":120,"wires":[["e1386972bf084a0b"],["cc6a9555e9c3538e"]]}]
Environment
- Node-RED version: 5.0.7
- Node.js version: 24.20.0
- npm version:
- Platform/OS: FlowFuse Launcher Version 3.1.0
- Browser: Brave 1.96.61 (Official Build) (64-bit)
Reactions are currently unavailable
Activity
[-]Importing backend is not align with UI[/-][+]Importing flow - backend is not align with UI[/+]