While trying to save the undostack to make it persistent, I noticed that move event are not serialized correctly, indeed, oldParentId and oldCoordinate are not saved into the JSON, I don't know if it's the expected behaviour, but it seems pretty strange:
It can be reproduced easily, first move a block into the workspace, then run the following code, and undo the last event, it will throw an error (Cannot read property 'nextConnection' of null).
constsave=Blockly.mainWorkspace.undoStack_.map(function(event){returnevent.toJson();});Blockly.mainWorkspace.clearUndo();Blockly.mainWorkspace.undoStack_=save.map(function(event){returnBlockly.Events.fromJson(event,Blockly.mainWorkspace);}If this is indeed a bug, I could submit the fix I wrote for my app.
ex0ns
While trying to save the undostack to make it persistent, I noticed that move event are not serialized correctly, indeed,
oldParentIdandoldCoordinateare not saved into the JSON, I don't know if it's the expected behaviour, but it seems pretty strange:It can be reproduced easily, first move a block into the workspace, then run the following code, and undo the last event, it will throw an error (
Cannot read property 'nextConnection' of null).If this is indeed a bug, I could submit the fix I wrote for my app.
ex0ns