Changing attribute outside of a transuction

I have an application using gojs,
there are some operations that I do not want to be part of the undo/redo mechanism.
for example I want to highlight nodes that have validation errors, And I do not want the highlighting to be part of the undo/redo because this is not an operation the user is doing.

is this possible?

The idea is to temporarily set Diagram.skipsUndoManager to true.

If all of the changes should not be recorded by the UndoManager, it’s easiest to call Diagram.commit with a second argument that is null.
https://gojs.net/latest/api/symbols/Diagram.html#commit

I tried to scroll to the highlighted node,

this.diagram.commit(() => {
             this.diagram.clearHighlighteds();
               part.isHighlighted = true
           }, null);
this.diagram.commandHandler.scrollToPart(part)

but with there was no animation.
I then changed the second line to be like this

setTimeout(() => this.diagram.commandHandler.scrollToPart(part),200);

and than I see the animation.

why should I wait so long?
where am I wrong?

I think we’ll improve this in version 2.1. Announcing GoJS 2.1 Alpha Release