Swapping order of ports doesn't update links

Hi,
Swapping order ports in the example
[Dynamic Ports * (gojs.net)] (Dynamic Ports)
it does not update the link from the swap port.
How to fix it?

The link between the swap port and the other port is updated after the node shift.

Thanks for reporting that problem. We’ll investigate.

I think you can fix the sample by adding these statements to invalidate the routes of Links that are connected with those ports:

        // remember the new Array in the model
        myDiagram.model.setDataProperty(port.part.data, port._side + "Array", newarr);
        // ADD THESE TWO LINES, OR SOMETHING EQUIVALENT:
        port.part.findLinksConnected(newarr[i].portId).each(l => l.invalidateRoute());
        port.part.findLinksConnected(newarr[i+1].portId).each(l => l.invalidateRoute());
        myDiagram.commitTransaction("swap ports");

It works, thanks