inspecting the way then Node.send works (node-red/Node.js at 34cb93794cd7c814f3ff7bd4fe036aa2fd7e29c9 · node-red/node-red · GitHub) it seems that all messages but the first sent on the first wire are cloned.
While cloning a message sent to multiple wires from the same output is a desirable behaviour, I would expect that the cloning flag is reset for messages sent on different outputs for the node and it would be the node responsibility to clone if necessary. Also if there is an array of messages sent to a single output on a single wire, none should be cloned. Currently, only the first message is not cloned, that is if I have
send([m1, m2]) and a single wire,
m2 is cloned.
Example of desired beahavior
In my node with 2 outputs I write
send([[m1, m2], [m3, m4]])
output 1 is connected to wire1 and wire2 and output2 to wire3 and wire4.
I would then expect the following behavior:
m1 is not cloned on w1
m1 is cloned on w2
m2 is not cloned on w1
m2 is cloned on w2
m3 is not cloned on w3
m3 is cloned on w4
m4 is not cloned on w3
m4 is cloned on w4
What are your thoughts?