Closed raararaara closed 1 week ago
The changes primarily enhance the RGATreeSplit
struct's garbage collection functionality by ensuring nodes are correctly deleted from two index trees. Additionally, debugging capabilities are improved by exposing tree structures through new methods in the Text
struct. New tests validate the correct behavior of these modifications.
Files | Change Summary |
---|---|
pkg/document/crdt/rga_tree_split.go | Modified Purge method to delete nodes from treeByIndex and treeByID trees before adjusting linked list. |
pkg/document/crdt/text.go | Added imports for llrb and splay . Introduced TreeByIndex and TreeByID methods for debugging. |
pkg/document/document_test.go | Added purge node from index during GC test within TestDocument to validate garbage collection functionality. |
test/integration/text_test.go | Added assertions to check the text weight using TreeByIndex . |
Objective (Issue) | Addressed | Explanation |
---|---|---|
Apply GCPair to TreeNode, TextNode (#866) | ✅ | |
Synchronization fails when editing including Undo In the CodeMirror example (#914) | ✅ |
In the land of code where data flows,
Trees now sway, in perfect rows.
Nodes purged, with precision and care,
Debugging made easy, solutions to share. 🌳
With tests in place, the system's bright,
Sync is smoother, all day and night. ✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Attention: Patch coverage is 42.85714%
with 4 lines
in your changes missing coverage. Please review.
Project coverage is 50.73%. Comparing base (
58d45c6
) to head (7031160
).
Files | Patch % | Lines |
---|---|---|
pkg/document/crdt/text.go | 0.00% | 4 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
What this PR does / why we need it:
Remove node from indexes during GC
While improving GC structure, we missed removing nodes from internal indexes of Text when purging tombstones.
This commit fixes #866.
Which issue(s) this PR fixes:
Addresses https://github.com/yorkie-team/yorkie/issues/914
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation:
Checklist:
Summary by CodeRabbit
New Features
TreeByIndex()
andTreeByID()
to facilitate debugging.Bug Fixes
Tests