* feat: return import status in import_batch method
* feat(wasm): add importUpdateBatch returned status support
* chore: add changeset update
* chore: update ffi return type
Fix the dead loop issue here: https://gist.github.com/sunflowerdeath/c0e2b46b6f5d2e32d368f8e04f730237
# Reason for the Dead Loop in `find_common_ancestor`
### Original Assumptions
1. **Dependency Assumption**
If a DagNode is depended upon by other nodes, the direction of this dependency will only point to before the end of the node. This assumption is used in system design.
2. **Node Overlap Assumption**
DagNodes do not overlap with each other. When retrieving DagNodes from two different positions:
- They are either completely identical
- Or they do not overlap at all
- If there is overlap, it means they are the same node
### Current Issues
1. **Issues Caused by Lazy Loading**
Due to the use of lazy loading, new situations have arisen. Initially:
- A certain DagNode is not depended upon by other DagNodes
- Therefore, the initially retrieved form is complete
2. **Impact of Subsequent Loading**
After loading additional DagNodes:
- The newly loaded DagNode may depend on the internal position of the previously complete DagNode
- This causes the originally complete DagNode to be split into multiple smaller DagNodes
3. **Violation of Original Assumptions**
In this case, when retrieving the content of the original DagNode again:
- Other DagNode dependencies may appear in the middle
- There may be overlaps on the DagNode
- This violates the original design assumptions
# Fix Approach
Remove the assumption in the original implementation that "overlapping DagNodes will not occur." When overlapping DagNodes are found, retain the shorter one and remove the longer one.
* fix: tree should use jitter 0 by default
Otherwise, there may be inconsistency between the event and the actual data. But this will increase the cost when the index property is not used.
* chore: add changeset
* chore: fix warning
* refactor: enable tree move by default
* docs: update related docs
* feat: Add isDeleted() method to containers
- Add isDeleted() method to all container types (Text, Map, List, Tree, etc.)
- Fix deletion tracking for containers in tree operations
- Add tests to verify deletion state across different scenarios
* chore: fix redundant field names
---------
Co-authored-by: Leon Zhao <leeeon233@gmail.com>
* feat: allow users to query the changed containers in the target id range
* chore: add changeset note
* chore: update cargo toml
* test: add related tests and add a commit before get_changed_container_in
* perf: use a priority-queue-based search for updating text
It tends to produce diffs with more continuous edits,
which is more efficient when we need to apply them to CRDTs
* fix: use better text diff calc
* refactor: add text update options struct
* chore: update text.update comments
* chore: fix warnings
* fix: rm a dumb optimization
* fix: avoid auto unsubscribe (due to gc) in js env
* fix: drop subscription if the subscriber is dropped
* perf: use manually drop
* fix: rm once_cell dep
* fix: should call unsubscribe
* perf: optimize high concurrency performance
* refactor: use new fronteirs impl init
* refactor: fix more type err
* refactor: fix more type err
* fix: fix more type err
* fix: all type errors and warnings
* fix: type error in tests
* fix: Debug impl
* fix: singular value
* fix: err
* fix: avoid potential err of frontiers merging
* fix: a few test issues
* test: add frontiers tests
* fix: all test errors
* chore: fix warnings
* chore: rm testing code
* perf: optimize dag related performance
* chore: rm outdated marks
* refactor: frontiers's map variant should contains at least 2 elements
* perf: reduce the cost of is_deleted check
* perf: speedup get_or_insert container
* perf: reduce the cost of get or insert with
* fix: store len
* perf: cache cursor for text insertions
* chore: fix warnings
* test: bench large folder with 1M files & 100M ops
* test: update task
* test: display trimmed snapshot size
* chore: record current test result
* perf: optimize the speed of ensure_vv
- (js) Refactor subscription mechanism to return unsubscribe function
- (rust) Implement must-use struct for subscriptions in Rust
- Enhance API ergonomics for JavaScript-like environments
- Improve resource cleanup and prevent potential memory leaks