Reordering node's array of ports after initial layout

i’m trying to re-order the array of a node’s ports after layout based on the display location. each node has a list of in-ports and out-ports which i want to re-order after displaying to try to help reduce link crossover. however whenever i try to set a node’s port array property using setDataProperty the model’s links get erased resulting in a flat stack of nodes with no links.

this.model.setDataProperty(node.data, 'inservices', newLeftPorts);

using a sorting function will not work since the criteria for re-sorting is based purely on the initial layout. is there a way to sort a node’s array of ports in-place? do i have to rebuild the links once i’ve called setDataProperty? how come the links in the model get removed when i call setDataProperty on a node?

That was fixed in version 1.7.20. GoJS version 1.7.20

new version works, thanks