I’m sorry, but I’m not getting that behavior.
I just took a random sample that I had lying around and added this listener:
$(go.Diagram, . . .,
"ModelChanged": e => {
if (e.isTransactionFinished) {
console.log(e.propertyName, e.model.nodeDataArray.length, myDiagram.nodes.count);
myDiagram.nodes.each(node => console.log(node.data));
}
},
"undoManager.isEnabled": true
})
I first selected all two nodes and copy-and-pasted them, resulting in four nodes. Then I did an undo and then a redo. The results were as expected:
CommittedTransaction 4 4
Object { key: 1, text: "hello", color: "green", location: "0 0", __gohashid: 725, loc: "19.5 13" }
Object { key: 2, text: "world", color: "red", location: "70 0", __gohashid: 726, loc: "91 13" }
Object { key: -3, text: "hello", color: "green", location: "0 0", __gohashid: 840, loc: "19.5 13" }
Object { key: -4, text: "world", color: "red", location: "70 0", __gohashid: 848, loc: "91 13" }
FinishedUndo 2 2
Object { key: 1, text: "hello", color: "green", location: "0 0", __gohashid: 725, loc: "19.5 13" }
Object { key: 2, text: "world", color: "red", location: "70 0", __gohashid: 726, loc: "91 13" }
FinishedRedo 4 4
Object { key: 1, text: "hello", color: "green", location: "0 0", __gohashid: 725, loc: "19.5 13" }
Object { key: 2, text: "world", color: "red", location: "70 0", __gohashid: 726, loc: "91 13" }
Object { key: -3, text: "hello", color: "green", location: "0 0", __gohashid: 840, loc: "19.5 13" }
Object { key: -4, text: "world", color: "red", location: "70 0", __gohashid: 848, loc: "91 13" }