How to manage single undo/redo for drag-and-drop with custom link handling in GoJS?

GraphObject.mouseDrop is a synchronous event handler – if present it is called by the DraggingTool on a mouse-up event, within the transaction. I think we agree that in your app that event handler will want to invoke something to cause an asynchronous transaction that actually splices a new Node (and Link) into where a Link had been.

If I add the following event handler to my Links, then when a drag-and-drop happens to drop a node onto that link, the drag-and-drop is cancelled.

  mouseDrop: (e, link) => {
    e.diagram.currentTool.doCancel();
  }

For within-diagram drag-and-drops, the node(s) go back to where they had started from. For palette-to-diagram drag-and-drops, there’s no new node, as if nothing had happened.