Skip to content

Offer "full serialization" and "minimal serialization" for events #1266

Description

@ex0ns

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    • Status
      Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions