fix: merge

This commit is contained in:
Leon Zhao 2024-06-13 15:11:29 +08:00
parent afac34755f
commit 0b3c6ba1d0
No known key found for this signature in database
GPG key ID: 449E9D4257BA04DE
5 changed files with 25 additions and 22 deletions

30
Cargo.lock generated
View file

@ -661,8 +661,8 @@ dependencies = [
"fxhash",
"itertools 0.12.1",
"loro 0.16.2",
"loro 0.16.2 (git+https://github.com/loro-dev/loro.git?rev=052ca29dc398eba150c8d9a4cebd6f506f1fb2e7)",
"loro-common 0.16.2 (git+https://github.com/loro-dev/loro.git?rev=052ca29dc398eba150c8d9a4cebd6f506f1fb2e7)",
"loro 0.16.2 (git+https://github.com/loro-dev/loro.git?branch=main)",
"loro-common 0.16.2 (git+https://github.com/loro-dev/loro.git?branch=main)",
"rand",
"serde_json",
"tabled 0.10.0",
@ -999,13 +999,13 @@ dependencies = [
[[package]]
name = "loro"
version = "0.16.2"
source = "git+https://github.com/loro-dev/loro.git?rev=052ca29dc398eba150c8d9a4cebd6f506f1fb2e7#052ca29dc398eba150c8d9a4cebd6f506f1fb2e7"
source = "git+https://github.com/loro-dev/loro.git?branch=main#afac34755f3f9a099c2985ff22dc9f2534d72290"
dependencies = [
"either",
"enum-as-inner 0.6.0",
"generic-btree",
"loro-delta 0.16.2 (git+https://github.com/loro-dev/loro.git?rev=052ca29dc398eba150c8d9a4cebd6f506f1fb2e7)",
"loro-internal 0.16.2 (git+https://github.com/loro-dev/loro.git?rev=052ca29dc398eba150c8d9a4cebd6f506f1fb2e7)",
"loro-delta 0.16.2 (git+https://github.com/loro-dev/loro.git?branch=main)",
"loro-internal 0.16.2 (git+https://github.com/loro-dev/loro.git?branch=main)",
"tracing",
]
@ -1029,12 +1029,12 @@ dependencies = [
[[package]]
name = "loro-common"
version = "0.16.2"
source = "git+https://github.com/loro-dev/loro.git?rev=052ca29dc398eba150c8d9a4cebd6f506f1fb2e7#052ca29dc398eba150c8d9a4cebd6f506f1fb2e7"
source = "git+https://github.com/loro-dev/loro.git?branch=main#afac34755f3f9a099c2985ff22dc9f2534d72290"
dependencies = [
"arbitrary",
"enum-as-inner 0.6.0",
"fxhash",
"loro-rle 0.16.2 (git+https://github.com/loro-dev/loro.git?rev=052ca29dc398eba150c8d9a4cebd6f506f1fb2e7)",
"loro-rle 0.16.2 (git+https://github.com/loro-dev/loro.git?branch=main)",
"nonmax",
"serde",
"serde_columnar",
@ -1061,7 +1061,7 @@ dependencies = [
[[package]]
name = "loro-delta"
version = "0.16.2"
source = "git+https://github.com/loro-dev/loro.git?rev=052ca29dc398eba150c8d9a4cebd6f506f1fb2e7#052ca29dc398eba150c8d9a4cebd6f506f1fb2e7"
source = "git+https://github.com/loro-dev/loro.git?branch=main#afac34755f3f9a099c2985ff22dc9f2534d72290"
dependencies = [
"arrayvec",
"enum-as-inner 0.5.1",
@ -1124,7 +1124,7 @@ dependencies = [
[[package]]
name = "loro-internal"
version = "0.16.2"
source = "git+https://github.com/loro-dev/loro.git?rev=052ca29dc398eba150c8d9a4cebd6f506f1fb2e7#052ca29dc398eba150c8d9a4cebd6f506f1fb2e7"
source = "git+https://github.com/loro-dev/loro.git?branch=main#afac34755f3f9a099c2985ff22dc9f2534d72290"
dependencies = [
"append-only-bytes",
"arref",
@ -1137,10 +1137,10 @@ dependencies = [
"im",
"itertools 0.12.1",
"leb128",
"loro-common 0.16.2 (git+https://github.com/loro-dev/loro.git?rev=052ca29dc398eba150c8d9a4cebd6f506f1fb2e7)",
"loro-delta 0.16.2 (git+https://github.com/loro-dev/loro.git?rev=052ca29dc398eba150c8d9a4cebd6f506f1fb2e7)",
"loro-rle 0.16.2 (git+https://github.com/loro-dev/loro.git?rev=052ca29dc398eba150c8d9a4cebd6f506f1fb2e7)",
"loro_fractional_index 0.16.2 (git+https://github.com/loro-dev/loro.git?rev=052ca29dc398eba150c8d9a4cebd6f506f1fb2e7)",
"loro-common 0.16.2 (git+https://github.com/loro-dev/loro.git?branch=main)",
"loro-delta 0.16.2 (git+https://github.com/loro-dev/loro.git?branch=main)",
"loro-rle 0.16.2 (git+https://github.com/loro-dev/loro.git?branch=main)",
"loro_fractional_index 0.16.2 (git+https://github.com/loro-dev/loro.git?branch=main)",
"md5",
"num",
"num-derive",
@ -1176,7 +1176,7 @@ dependencies = [
[[package]]
name = "loro-rle"
version = "0.16.2"
source = "git+https://github.com/loro-dev/loro.git?rev=052ca29dc398eba150c8d9a4cebd6f506f1fb2e7#052ca29dc398eba150c8d9a4cebd6f506f1fb2e7"
source = "git+https://github.com/loro-dev/loro.git?branch=main#afac34755f3f9a099c2985ff22dc9f2534d72290"
dependencies = [
"append-only-bytes",
"arref",
@ -1225,7 +1225,7 @@ dependencies = [
[[package]]
name = "loro_fractional_index"
version = "0.16.2"
source = "git+https://github.com/loro-dev/loro.git?rev=052ca29dc398eba150c8d9a4cebd6f506f1fb2e7#052ca29dc398eba150c8d9a4cebd6f506f1fb2e7"
source = "git+https://github.com/loro-dev/loro.git?branch=main#afac34755f3f9a099c2985ff22dc9f2534d72290"
dependencies = [
"imbl",
"rand",

View file

@ -10,15 +10,15 @@ publish = false
loro-without-counter = { path = "../loro", package = "loro" }
loro = { git = "https://github.com/loro-dev/loro.git", features = [
"counter",
], rev = "052ca29dc398eba150c8d9a4cebd6f506f1fb2e7" }
], branch = "main" }
loro-common = { git = "https://github.com/loro-dev/loro.git", features = [
"counter",
], rev = "052ca29dc398eba150c8d9a4cebd6f506f1fb2e7" }
], branch = "main" }
# loro = { path = "../loro", package = "loro", features = ["counter"] }
# loro-common = { path = "../loro-common", package = "loro-common", features = [
# "counter",
# ] }
# loro-without-counter = { git = "https://github.com/loro-dev/loro.git", rev = "43cc07daf7aada060d01505da5efcbc4e6cc2de8", package = "loro" }
# loro-without-counter = { git = "https://github.com/loro-dev/loro.git", branch = "main", package = "loro" }
fxhash = { workspace = true }
enum_dispatch = { workspace = true }
enum-as-inner = { workspace = true }

View file

@ -216,11 +216,13 @@ impl CRDTFuzzer {
}
_ => {
info_span!("JsonFormat", from = i, to = j).in_scope(|| {
let a_json = a_doc.export_json_updates(&b_doc.oplog_vv());
let a_json =
a_doc.export_json_updates(&b_doc.oplog_vv(), &a_doc.oplog_vv());
b_doc.import_json_updates(a_json).unwrap();
});
info_span!("JsonFormat", from = j, to = i).in_scope(|| {
let b_json = b_doc.export_json_updates(&a_doc.oplog_vv());
let b_json =
b_doc.export_json_updates(&a_doc.oplog_vv(), &b_doc.oplog_vv());
a_doc.import_json_updates(b_json).unwrap();
});
}

View file

@ -16,8 +16,9 @@ fn unknown_json() {
let counter = doc.get_counter("counter");
counter.increment(5.).unwrap();
counter.increment(1.).unwrap();
doc.commit();
// json format with counter
let json = doc.export_json_updates(&Default::default());
let json = doc.export_json_updates(&Default::default(), &doc.oplog_vv());
// Test1: old version import newer version json
if doc_with_unknown
.import_json_updates(serde_json::to_string(&json).unwrap())

View file

@ -969,7 +969,7 @@ fn counter() {
counter.increment(1.).unwrap();
counter.increment(2.).unwrap();
counter.decrement(1.).unwrap();
let json = doc.export_json_updates(&Default::default());
let json = doc.export_json_updates(&Default::default(), &doc.oplog_vv());
let doc2 = LoroDoc::new_auto_commit();
doc2.import_json_updates(json).unwrap();
}