Link's arrow head frozen at 90 deg angle

I have a problem with the red link. When I drag a node around it looks like the red arrow head is stuck in a single orientation (it always points down). The green arrow head rotates properly. What could be the issue?

Properties comparison between the red and green links:

Different node positions resulting in the incorrect arrow head orientation:

When you look at Spot values in the debugger, you may find it more meaningful to call toString on the value. redArrow.toSpot seems to be Spot.Default, so it would inherit the spot value from the redArrow.toPort.toSpot, which seems to be Spot.AllSides.

What is the value for the redArrow.toPort.getDocumentBounds()`? Is it a small port, or is it the big Shape of the whole Node?

If it is a small port on the left side of the node, then you really don’t want to have the fromSpot or toSpot be Spot.AllSides, but only Spot.Left or Spot.LeftSide.

I used the following function to investigate the issue:

function linkInfo(link: go.Link){
  return {
    linkToSpot: link.toSpot.toString(),
    nodeToSpot: link.toNode?.toSpot.toString(),
    nodeToPortBounds: link.toPort?.actualBounds.toString(),
    nodeToPortSpot: link.toPort?.toSpot.toString(),
    arrowAngle: link.elt(2).angle
  }
}

The port is the main shape of the node “RoundedRectangle”.

When I move nodes around, angle of the red link is frozen. What could impact arrow’s angle this way?

For normal links, that doesn’t make any sense. Are you using a subclass of Link? If so, how is it defined?

Or you’ve set Link.adjusting.

The issue is that the link.data.toPort uses a port id of a port that no longer exists. Our model is configured to use it by setting the linkToPortIdProperty. When it tries to connect to a port that no longer exists the arrow head freezes.

Node.findPort if it doesn’t find an element with the given port identifier returns the default port for the node, Node.port.

So you might want to check the spot properties of the default port.