feat: implement CRDT support and efficient run-based text synchronization#25
Merged
feat: implement CRDT support and efficient run-based text synchronization#25
Conversation
- Optimized text storage by grouping contiguous characters into runs. - Added Reserve(n) to HLC clock to support implicit character IDs. - Implemented automatic splitting, merging, and normalization of runs. - Added comprehensive tests for convergence and run management.
- Extracted metadata update logic into updateMetadataLocked. - Added CreateDelta method to promote a standard deep.Patch to a crdt.Delta. - Updated tests to verify clock and metadata consistency.
- Introduced basePatch struct to handle conditions and metadata. - Replaced redundant method implementations in all patch types. - Updated serialization and tests to use the new basePatch structure. - Improved code maintainability and reduced overall complexity.
- Added JSON serialization tests for CRDT. - Added comprehensive edge case tests for run-based Text deletion. - Improved HLC coverage to 93%+ with thorough Compare/Update tests. - Added tests for Put builder method and missing toJSONPatch cases. - Fixed customDiffPatch testing logic.
- Fixed duplicate JSON tag in websocket_sync example. - Applied go fmt across the entire codebase. - Verified with go vet and go fix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces full support for Conflict-free Replicated Data Types (CRDTs) and distributed state synchronization. It enables
seamless merging of concurrent changes across different nodes with guaranteed deterministic convergence.
Key Features:
drastically reduces metadata overhead and supports concurrent edits through intelligent run splitting and automatic
normalization.
indices.
construction.
improving maintainability.
Technical Details: