Open umesh-timalsina opened 1 year ago
On formalizing, a node patch interface should look like the following?
interface NodePatch {
core: GmeClasses.Core;
put: (node: Core.Node, change: NodeChangeSet, resolvedSelectors) => Promise<PatchResult>;
del: (node: Core.Node, change: NodeChangeSet, resolvedSelectors) => Promise<PatchResult>;
}
and we need to implement these for each key of NodeState
. An attribute patch would be:
class AttributePatch implements NodePatch{
...
}
In the first example, I would expect it to recreate child3
since we are using apply
. I believe it should assign the correct GUID and everything to the re-created child node.
Okay, I can add a test for this.
While working on
webgme-diffsync
, I realize that changeset'sChangeType.put
orChangeType.del
will always succeed (case in point, setting a pointer to a removed node) when usingNodeState
as T2 forwebgme-diffsync
. While this might not be of concern forWJI
, second guessing the change success/failure in the callee is also not ideal. I am opening this issue to start a discussion on formalizing theseChangeSet
patch operations (for increased type correctness as well as ease of use).MWE