You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When performing garbage collection (GC) on nested objects, the deregister process leads to redundant operations on child nodes. This issue arises because the deregister iterates over children, while getDescendants also performs a similar traversal, resulting in unnecessary duplication.
Garbage collection should efficiently iterate over children only once, deregistering them, and returning the accurate count of garbage-collected nodes.
How to reproduce it (as minimally and precisely as possible):
Execute the following test code:
it.only('test',asyncfunction({ task }){typeTestDoc={shape?: {point?: {x?: number;y?: number}}};constdocKey=toDocKey(`${task.name}-${newDate().getTime()}`);constdoc=newyorkie.Document<TestDoc>(docKey);doc.update((root)=>{root.shape={point: {x: 0,y: 0}};deleteroot.shape;});assert.equal(doc.getGarbageLen(),4);// shape, point, x, yassert.equal(doc.garbageCollect(MaxTimeTicket),4);// The number of GC nodes must also be 4. (It's 6 for now.)});
Anything else we need to know?:
This issue was reported in #714 .
The deregisterElements logic has been modified in #691 .
Environment:
Operating system:
Browser and version:
Yorkie version (use yorkie version): v0.4.11
Yorkie JS SDK version: v0.4.11
The text was updated successfully, but these errors were encountered:
What happened:
When performing garbage collection (GC) on nested objects, the deregister process leads to redundant operations on child nodes. This issue arises because the
deregister
iterates over children, whilegetDescendants
also performs a similar traversal, resulting in unnecessary duplication.yorkie-js-sdk/src/document/crdt/root.ts
Lines 168 to 191 in a714e66
yorkie-js-sdk/src/document/crdt/object.ts
Lines 215 to 231 in a714e66
What you expected to happen:
Garbage collection should efficiently iterate over children only once, deregistering them, and returning the accurate count of garbage-collected nodes.
How to reproduce it (as minimally and precisely as possible):
Execute the following test code:
Anything else we need to know?:
This issue was reported in #714 .
The deregisterElements logic has been modified in #691 .
Environment:
yorkie version
):v0.4.11
v0.4.11
The text was updated successfully, but these errors were encountered: