Commit graph

1628 commits

Author SHA1 Message Date
Zixuan Chen
fe85805327
refactor: provide all version info for diff calc instance
This can avoid the use of shrink_frontiers
2024-09-26 10:14:27 +08:00
Zixuan Chen
e25b93c491
chore: use cached diff calc 2024-09-26 00:25:39 +08:00
Zixuan Chen
35854743f0
fix: checkout into middle of marks 2024-09-25 23:00:01 +08:00
Zixuan Chen
672062c9d1
fix: gc snapshot error (#481)
it should retain all containers created after the `from` version
2024-09-25 22:35:29 +08:00
Zixuan Chen
f1bb4f1020
test: make awareness more robust 2024-09-25 20:54:49 +08:00
Zixuan Chen
cec99f8f7e
feat: add clear methods (#478)
* feat: add clear method

* feat: expose clear fn to wasm and rust
2024-09-25 20:50:55 +08:00
Zixuan Chen
66047f7909
feat: update text by line (#480) 2024-09-25 20:50:36 +08:00
Zixuan Chen
78aaa4080d
Fix tree cache checkout issue and add a few invariance checks (#479)
* test: test failed if use non-cached diff calc

* fix: tree diff calc retreat cache current vv

* feat(wasm): commit message & get pending ops length

* bk

* chore: add tree one doc fuzz

* fix: fix the problem and added a few checks

* chore: rm debugging code

* fix: encode snapshot when detached

---------

Co-authored-by: leeeon233 <leeeon233@gmail.com>
2024-09-25 20:50:10 +08:00
Leon Zhao
261cdda674
fix: get correct tree_cache current vv when retreating (#476)
* test: test failed if use non-cached diff calc

* fix: tree diff calc retreat cache current vv

* fix: better tree cache current vv

---------

Co-authored-by: Zixuan Chen <remch183@outlook.com>
2024-09-25 20:38:26 +08:00
Zixuan Chen
6bb424d65f
feat(wasm): commit message & get pending ops length (#477) 2024-09-25 20:38:10 +08:00
Zixuan Chen
18855bafd3
chore: bump version 2024-09-24 18:10:02 +08:00
Zixuan Chen
c6f1a4c0ae
fix(wasm): type err 2024-09-24 18:08:29 +08:00
Zixuan Chen
bef39ce6b5
Feat: allow editing on detached mode (#473)
* refactor: add detached editing config and prepare the architecture for editing detached doc

* feat: subscribe for peer id change

* fix: undo after checkout & add tests for detached editing

* test: add fuzzer for detached editing

* feat: expose detached editing configure to wasm

* test: add wasm test for detached editing
2024-09-24 11:16:59 +08:00
Zixuan Chen
88e9ec9595
Fix: should not emit event when exporting gc-snapshot (#471)
* test: add no event test

* fix: should not emit event when exporting gc snapshot

* fix: not emitting events when exporting state only snapshot

* fix: type error
2024-09-24 10:38:00 +08:00
Zixuan Chen
2016f31f54
fix: cursor behavior when using gc-snapshot (#472) 2024-09-24 10:28:16 +08:00
Zixuan Chen
1082af0d46
Fix: get tree's alive children correctly (#474)
* test: add a failed case

* fix: get tree's alive children correctly
2024-09-24 10:27:57 +08:00
Zixuan Chen
082a9c1ab8
chore: make tree parent id pub on loro crate 2024-09-23 11:40:02 +08:00
Zixuan Chen
9294648c8e
chore: 1.0-alpha.2 2024-09-23 10:20:28 +08:00
Zixuan Chen
bdf006ed2e
feat: fork doc at the target version (#469) 2024-09-23 09:51:07 +08:00
Leon Zhao
3fe619bc81
refactor: use hierarchy value for tree value (#470)
* refactor: use hierarchy value for tree value

* fix: get_container_deep_value_with_id

* feat: get tree nodes by flat format
2024-09-23 09:05:12 +08:00
Zixuan Chen
bb494df230
chore: bump version to v1.0.0-alpha.1 2024-09-20 18:16:49 +08:00
Leon Zhao
aab6730b4d
fix: tree undo when converting movement to creation, new target id should be used (#468)
* test: a checkout event err

* fix: tree undo convert moving to creating should use new target tree id

---------

Co-authored-by: Zixuan Chen <remch183@outlook.com>
2024-09-20 16:51:37 +08:00
Zixuan Chen
d460346585
feat: jsonpath experimental support (#466)
* feat: jsonpath experimental support

* fix: add support for negative index unionindex and unionkey

* chore: export lorodoc in loro-js and fix a few tests related to map's entries order

* chore: fix type err
2024-09-19 19:22:39 +08:00
Leon Zhao
7f9bfa8a85
refactor: tree contains & isDeleted (#467) 2024-09-19 11:21:54 +08:00
Zixuan Chen
1ea2a24d74
fix: export snapshot error on a gc doc 2024-09-19 11:08:34 +08:00
Zixuan Chen
e592d4f830
fix: raise error if moving a deleted node 2024-09-17 16:04:00 +08:00
Zixuan Chen
76803506b6
feat: add new cid method to js binding 2024-09-17 13:05:06 +08:00
Zixuan Chen
8dcb619147
fix: raise error if perform action on a deleted container (#465)
- Add ContainerDeleted error variant to LoroError
- Implement is_deleted() method for container handlers
- Check for deleted containers before applying operations
- Add dead_containers_cache to DocState to track deleted containers
- Update apply_diff to optionally clear dead container cache
- Add tests for handling operations on deleted containers
- Implement checkout to reset container deleted cache
- Minor code cleanup and typo fixes
2024-09-17 12:09:20 +08:00
Zixuan Chen
2f38708a50
Fix a tree checkout issue on GcSnapshot (#464)
* test: a failed test case

* fix: tree checkout init err

* fix: export from

* chore: add cov

* fix: movable list undo/redo apply delta err

* refactor: refactor by o1-preview 🤯

* refactor: extract arguments

* test: add cov

* fix: use correct method to get was_alive for tree node

* fix: tree event was alive err

---------

Co-authored-by: Leon Zhao <leeeon233@gmail.com>
2024-09-17 00:19:29 +08:00
Zixuan Chen
0f1df49b9e
feat: add state only snapshot & refine check slow test 2024-09-13 22:35:43 +08:00
Zixuan Chen
d678114681
test: check state correctness on trimmed doc 2024-09-13 19:59:28 +08:00
Zixuan Chen
c18cec15a9
fix: lazy load dag node 2024-09-13 18:39:44 +08:00
Zixuan Chen
15175a1e5f
chore: update pkg files 2024-09-13 17:48:57 +08:00
Leon Zhao
f3b1482370
feat: get shallow value of doc (#463)
* feat: get shallow value

* chore: rename
2024-09-13 17:09:09 +08:00
Zixuan Chen
f1374c3bd0
Merge branch 'main' into dev 2024-09-12 22:30:42 +08:00
Zixuan Chen
690b7229ce
Merge pull request #431 from loro-dev/feat-gc
feat-gc
2024-09-12 22:21:21 +08:00
Zixuan Chen
3d3635afbb
test: add tests for all export methods 2024-09-12 22:19:48 +08:00
Zixuan Chen
38d1c279d9
feat: add new export api to wasm 2024-09-12 22:16:55 +08:00
Zixuan Chen
9040747620
fix: ensure all alive containers are encoded in doc state snapshot 2024-09-12 20:53:50 +08:00
Zixuan Chen
a9d4de7a18
Test: Add fuzzing tests for gc mode correctly & fix several failed cases (#461)
* test: fuzz gc correctly

* fix: lots of gc snapshot issues

* fix: vv to frontiers

* test: add an arbtest for gc fuzzing tests

* test: fix a few test issues

* fix: apply diff of a dangling container that was deleted before trimmed version
2024-09-12 20:07:57 +08:00
Zixuan Chen
f39b34e854
Merge pull request #449 from loro-dev/zxch3n/loro-912-opt-export-updates-block-encode
Optimize block encoding schema & new encoding schema for updates
2024-09-12 19:45:27 +08:00
leeeon233
5450e511d0
chore: merge gc 2024-09-12 17:24:40 +08:00
leeeon233
3ecbc34b26
Merge branch 'feat-gc' into zxch3n/loro-912-opt-export-updates-block-encode 2024-09-12 17:13:06 +08:00
Zixuan Chen
db1111cf83
test: fix gc fuzz preprocess 2024-09-11 23:56:37 +08:00
Zixuan Chen
81c9f3aacc
Merge branch 'test-add-gc-fuzz-test' into feat-gc 2024-09-11 23:36:16 +08:00
Zixuan Chen
88f9e5fa45
test: add fuzzing tests for gc snapshot 2024-09-11 23:34:05 +08:00
Zixuan Chen
99c012c20a
fix: raise error if importing updates that dep on trimmed history (#457)
* fix: raise error if importing updates that dep on trimmed history

* test: check event correctness
2024-09-11 22:54:39 +08:00
Zixuan Chen
21e3ffea45
perf: refine state fast snapshot & fix a few tree event issues (#459)
* perf: refine state fast snapshot

* fix: tree apply diff err

* fix: get child index

* fix: use better tree event
2024-09-11 22:54:14 +08:00
Leon Zhao
dfc99c1746
feat: block encode header (#458)
* bk

* feat: encode header

* chore: use columnar 0.3.9

* fix: not need encode last lamport and length

* chore: cargo fix

* fix: print

* bk

* chore: columnar 0.3.10
2024-09-11 22:53:10 +08:00
Leon Zhao
f7bd2aefff
feat: do not compress if larger after compressing (#455)
* feat: do not compress if larger after compressing

* test: add related tests and ensure coverage

---------

Co-authored-by: Zixuan Chen <remch183@outlook.com>
2024-09-11 18:13:41 +08:00