GOJS crashed when moving a group

From time to time, when I drag a group and tries to relocate it, gojs freezes and i get the following stack trace :

It happens also when i expand or collapse a group.

What does ZoneDelegate.invokeTask do? Why is it calling eval? Is that part of Angular?

There are no calls to eval in go.js.

I notices that when i clear the diagram it iterate all diagram layers and remove them, including “out of the box” layers (“Background”, “Forground”…).
I fixed this bug.
Could it affect gojs ?
I believe so…

I just checked, and Diagram.clear does not remove any Layers. It does clear all of those layers of any Parts that are in them, but the layers remain in the diagram.

So I cannot explain what you have observed. Perhaps you were doing your own “clear” operation?

The problem is that i didn’t use the native clear() function but i implemented it myself.
I will use the native one and hope it will not crash anymore.

How did you implement your own? Maybe we do have a bug there.

Actually, it is most common to just replace the Diagram.model with an empty model.

Actually i set nodedataarry and linkdataarray to [] and also remove my custom made layers

That works reliably in my experience. How did you remove your custom layers?

Maybe the problem does not involve clearing the diagram at all.

I call diagram.removeLayer() to each of my custom made layers.
Is there any smart way to clear the diagram and its layers ?

Does calling Diagram.clear do what you want?

Note that it also clears the Model and the UndoManager, which you didn’t say whether you did that or not in your own code.

I set nodeDataArray and LinkDataArray to [];
I will call the native clear()