-
Notifications
You must be signed in to change notification settings - Fork 1
Some change operations need to fail? #46
Copy link
Copy link
Open
Description
While working on webgme-diffsync, I realize that changeset's ChangeType.put or ChangeType.del will always succeed (case in point, setting a pointer to a removed node) when using NodeState as T2 for webgme-diffsync. While this might not be of concern for WJI, second guessing the change success/failure in the callee is also not ideal. I am opening this issue to start a discussion on formalizing these ChangeSet patch operations (for increased type correctness as well as ease of use).
MWE
const fco = await core.loadByPath(rootNode, '/1');
const parent = core.createNode({
parent: rootNode,
base: fco
});
const child1 = core.createNode({
parent: parent,
base: fco
});
const child2 = core.createNode({
parent: parent,
base: fco
});
const child3 = core.createNode({
parent: parent,
base: fco
});
core.setPointer(child1, 'sibling', child2);
const syncer = new JSONImporter(core, rootNode);
const state = await importer.toJSON(parent);
const deletedPointerGuid = core.getGuid(child3);
core.deleteNode(child3);
state.children[1].pointers.sibling = deletedPointerGuid;
await importer.apply(parent, state); // Should this fail? Can we formalize this a bit better
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels