node-red / node-red

Low-code programming for event-driven applications
http://nodered.org
Apache License 2.0
18.93k stars 3.31k forks source link

Fix losing links when importing a copy of links into a subflow #4750

Closed GogoVega closed 2 weeks ago

GogoVega commented 3 weeks ago

Proposed changes

Fixes #4749.

Fixes node_map does not contain as key the new id of a copied node.

It's new_nodes which contains the new ids. At the end of updating the new nodes, they are added to node_map which explains why they are in the image.

Checklist

GogoVega commented 2 weeks ago

Definitely not my PR 😅

What properties can have def.type outside config node select input (and links)?

knolleary commented 2 weeks ago

@GogoVega in theory any property can have the type property if it contains references to other nodes.

The Catch/Status/Complete nodes have it - https://github.com/node-red/node-red/blob/master/packages/node_modules/%40node-red/nodes/core/common/25-catch.html#L34