Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inconsistent garbage collection for multiple nodes in text and tree type #855

Merged
merged 1 commit into from
May 10, 2024

Conversation

chacha912
Copy link
Contributor

What this PR does / why we need it:

There was an issue in the garbage collection process when dealing with multiple nodes in text(tree) types. When some nodes in text were collected, the corresponding text was removed from elementHasRemovedNodesSetByCreatedAt in the root, preventing the GC from correctly processing the remaining nodes.

This PR addresses the inconsistency in the GC process by modifying the condition under which text is removed from elementHasRemovedNodesSetByCreatedAt. Instead of removing text when some nodes are garbage collected, text will now only be removed when all nodes have been garbage collected. This change ensures that GC behaves consistently even when multiple nodes are involved.

Which issue(s) this PR fixes:

Related yorkie-team/yorkie-js-sdk#806

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Additional documentation:


Checklist:

  • Added relevant tests or not required
  • Didn't break anything

Copy link

codecov bot commented May 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.81%. Comparing base (5a77d08) to head (bb2d517).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #855   +/-   ##
=======================================
  Coverage   50.81%   50.81%           
=======================================
  Files          70       70           
  Lines       10285    10285           
=======================================
  Hits         5226     5226           
  Misses       4530     4530           
  Partials      529      529           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hackerwins hackerwins self-requested a review May 10, 2024 05:29
Copy link
Member

@hackerwins hackerwins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution.

@hackerwins hackerwins merged commit 503ed59 into main May 10, 2024
4 checks passed
@hackerwins hackerwins deleted the fix-gc branch May 10, 2024 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants