When I manually update the portId of all links, i.e.
diagram.links.first().toPortId = "ABC";
then the link points to the correct panel again.
From documentation: “… and that automatically updates any bindings. This override handles link data as well as node data.”
When I use provided methods (i.e. setDataProperty) to update the data, then I would expect that all related diagram elements are updated too (in this case the toPortId of the Link).
(I also would expect that the diagram is notified about the change and automatically updates the view after the commit (but this is not specified in the documentation).)
The model data holds the “truth” for what exists in any diagram showing that model.
If you change a port identifier, then all links with references using the old identifier are not supposed to be connecting with that port, and all links referring to the new identifier are suddenly connecting with it.
If you want to maintain the original graph structure, you need to update all of the references. But I hope you can see how in other situations one might want the flexibility to achieve different results than what I think you want in this case.