Change not within a transaction - GoJS little bug or something else

Ok I know this is not error just warning that some bad practice maybe occurs. I’m getting these messages after loading a model. I searched everywhere in my code where this change maybe occurs to find out where to put start/commit transaction methods.

Change not within a transaction: !m points: SeqFlow_0  old: undefined  new: List(Point)#2163
go.js:35 Change not within a transaction: !m points: SeqFlow_1  old: undefined  new: List(Point)#2193
go.js:35 Change not within a transaction: !m points: SeqFlow_2  old: undefined  new: List(Point)#2224

Then I looked inside link template and only line there that is related to points was binding line.

new go.Binding("points").makeTwoWay(),

If I comment this warning disappears. This tells me that something inside default binding functions causes appearance of ‘Change not within transaction’ warning in console.

I’m using latest version of GoJS.

Do the messages only happen immediately after loading a model, and not after any other actions/changes?

They happen and if I move node with that link. There is also bunch of similar messages related to other properties and as I can recognize most of them are related to bound properties. I dunno can this console output be useful for you.

Change not within a transaction: !d isTreeLeaf: Node#1952(Start Diagram)  old: false  new: true
go.js:35 Change not within a transaction: !dChangedEvent.Remove parts: Layer ""  old: Link#2021(SeqFlow_0) 3
go.js:35 Change not within a transaction: !d isTreeLeaf: Node#1965(Do all things before continue)  old: false  new: true
go.js:35 Change not within a transaction: !dChangedEvent.Remove parts: Layer ""  old: Link#2030(SeqFlow_1) 3
go.js:35 Change not within a transaction: !d isTreeLeaf: Node#1982(Something)  old: false  new: true
go.js:35 Change not within a transaction: !dChangedEvent.Remove parts: Layer ""  old: Link#2039(SeqFlow_2) 3
go.js:35 Change not within a transaction: !dChangedEvent.Remove parts: Layer ""  old: Node#1952(Start Diagram) 0
go.js:35 Change not within a transaction: !dChangedEvent.Remove parts: Layer ""  old: Node#1965(Do all things before continue) 0
go.js:35 Change not within a transaction: !dChangedEvent.Remove parts: Layer ""  old: Node#1982(Something) 0
go.js:35 Change not within a transaction: !dChangedEvent.Remove parts: Foreground  old: Node#2004(Do all things before continue) 0
go.js:35 Change not within a transaction: !dChangedEvent.Insert parts: Layer ""  new: Node#2365(Start Diagram) 0
go.js:35 Change not within a transaction: !d data: Node#2365(Start Diagram)  new: Start Diagram
go.js:35 Change not within a transaction: !d location: Node#2365(Start Diagram)  old: Point(NaN,NaN)  new: Point(20,150)
go.js:35 Change not within a transaction: !d fill: SHAPE  old: black  new: white
go.js:35 Change not within a transaction: !d stroke: SHAPE  old: black  new: darkgray
go.js:35 Change not within a transaction: !d figure: Shape(Empty)#2371  old: NotAllowed  new: Empty
go.js:35 Change not within a transaction: !d fill: Shape(Empty)#2371  old: black  new: white
go.js:35 Change not within a transaction: !d text: Start Diagram  old:   new: Start Diagram
go.js:35 Change not within a transaction: !dChangedEvent.Insert parts: Layer ""  new: Node#2378(Do all things before continue) 1
go.js:35 Change not within a transaction: !d data: Node#2378(Do all things before continue)  new: Do all things before continue
go.js:35 Change not within a transaction: !d location: Node#2378(Do all things before continue)  old: Point(NaN,NaN)  new: Point(147.5,146.5)
...
Change not within a transaction: !d points: Link#2434(SeqFlow_0)  old: List(Point)#2443  new: List(Point)#2556
go.js:35 Change not within a transaction: !m points: SeqFlow_0  old: List(Point)#2163  new: List(Point)#2556
go.js:35 Change not within a transaction: !d points: Link#2444(SeqFlow_1)  old: List(Point)#2453  new: List(Point)#2586
go.js:35 Change not within a transaction: !m points: SeqFlow_1  old: List(Point)#2194  new: List(Point)#2586
go.js:35 Change not within a transaction: !d points: Link#2454(SeqFlow_2)  old: List(Point)#2462  new: List(Point)#2617
go.js:35 Change not within a transaction: !m points: SeqFlow_2  old: List(Point)#2353  new: List(Point)#2617

As you can see this occurs even for links that I didn’t moved at all.

That’s odd. Could you check that all of your calls to startTransaction are matched at run-time by a call to commitTransaction (or rollbackTransaction), and that there are no calls to commitTransaction without a corresponding call to startTransaction?

This doesn’t happen in other samples that have new go.Binding("points").makeTwoWay(). I’m wondering what might be different in your app.

These message started showing up when I started to use debug version. With no debug version they does not showing up.

Yes, those messages only show in the debug version.

Do undo and redo work as you would expect?

How do you load the model?

What event handlers/listeners do you have, and what do they do?

Yes undo/redo works as expected. My model is loaded from xml file which is then parsed and created GoJS version of model. I have a many event listeners but nothing of them is not triggered before those messages are shown in console after loading. I inspected all of my listeners code looking for source of warning and didn’t find anything. That is lead me to check templates and when I commented binding of link points message disappeared from console at least during model loading.

OK, I guess it’s come down to our getting the smallest and simplest example that demonstrates the problem. If you’re up for that. If you don’t want to bother coming up with a stand-alone sample that we can analyze, we can understand, since you say your app is otherwise working well.

Yeah everything works for me. And I don’t have a time to create any sample because I have a lot of work to do for a project.

Hi walter,
i got messages. It’s only happen immediately after loading a graph.

Change not within a transaction: !d points: Link#2335([object Object]) old: List(Point)#3257 new: List(Point)#3335
go-debug.js?0012:35 Change not within a transaction: !d points: Link#2343([object Object]) old: List(Point)#3265 new: List(Point)#3337
go-debug.js?0012:35 Change not within a transaction: !d points: Link#2351([object Object]) old: List(Point)#3273 new: List(Point)#3338
go-debug.js?0012:35 Change not within a transaction: !d points: Link#2359([object Object]) old: List(Point)#3283 new: List(Point)#3339
go-debug.js?0012:35 Change not within a transaction: !d points: Link#2367([object Object]) old: List(Point)#3291 new: List(Point)#3340

Do you have any idea for this logs?

I’m still interested in finding out how to reproduce this. A long time ago I spent some time trying to do so, but I was unable.

In this case I think these messages are harmless.

Please refer to this fiddle:
https://fiddle.jshell.net/tiepna/z3jjwxm7/5/

I am getting this error in the console and have no idea why. Im not using any tree to deal with tree leaf.
Change not within a transaction: !d isTreeLeaf: 7 old: false new: true

I’m guessing it’s because you are removing a link between two nodes, and I’m guessing that it was the last link coming out of node 7, causing the node to change from a non-“leaf” node into a “leaf” node. Is that what is happening when you get the message? I hope the warning message is self-explanatory now.

I’m creating 2 nodes, link them together then copy and paste (incrementing node ids to avoid duplicates). Then I copy the pasted parts again as they are still selected, change the diagram model to empty (for me it’s a different tab, like a different document) and paste it there. This is when it happens.

EDIT: I was just able to reproduce the problem. It happens when the Diagram.model is replaced, and it needs to clear out the diagram by removing all of its old parts. We’ll investigate. I don’t think it’s anything for you to worry about. Thanks for reporting it!

I believe this will be fixed in 2.1.1. Sorry for the false warnings – I hope they did not confuse you too much. Thanks again for reporting the problem.

Note that you can only have seen those warnings in debug mode. That combined with the infrequency of the bug kept us from seeing the problem before.