From 5badffc97b17984d5f25a178c0c5a477338039c4 Mon Sep 17 00:00:00 2001 From: Bartosz Sypytkowski Date: Tue, 27 Aug 2024 13:58:58 +0200 Subject: [PATCH] chore: update yrs and appflowy collab (#759) * chore: update yrs and appflowy collab * chore: increased allowed number of dependencies --- Cargo.lock | 71 ++++++++++++++++++------- Cargo.toml | 12 ++--- libs/client-api-test/src/test_client.rs | 10 ++-- script/client_api_deps_check.sh | 2 +- 4 files changed, 64 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aafa05c2..41bd3760 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -619,7 +619,7 @@ dependencies = [ "collab-rt-protocol", "collab-stream", "collab-user", - "dashmap", + "dashmap 5.5.3", "database", "database-entity", "derive_more", @@ -704,7 +704,7 @@ dependencies = [ "collab-rt-entity", "collab-rt-protocol", "collab-stream", - "dashmap", + "dashmap 5.5.3", "database", "database-entity", "dotenvy", @@ -752,7 +752,7 @@ dependencies = [ "collab", "collab-entity", "collab-stream", - "dashmap", + "dashmap 5.5.3", "database", "dotenvy", "futures", @@ -896,6 +896,17 @@ dependencies = [ "serde_json", ] +[[package]] +name = "async-lock" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + [[package]] name = "async-stream" version = "0.3.5" @@ -944,12 +955,6 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" -[[package]] -name = "atomic_refcell" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41e67cd8309bbd06cd603a9e693a784ac2e5d1e955f11286e355089fcab3047c" - [[package]] name = "authentication" version = "0.1.0" @@ -2080,7 +2085,7 @@ dependencies = [ [[package]] name = "collab" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=ec4f92941942f20c84dce142cd2eeafd44ca7362#ec4f92941942f20c84dce142cd2eeafd44ca7362" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf5c871191e5fbbaa58af5ab7cb037f792e28297#cf5c871191e5fbbaa58af5ab7cb037f792e28297" dependencies = [ "anyhow", "arc-swap", @@ -2105,7 +2110,7 @@ dependencies = [ [[package]] name = "collab-document" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=ec4f92941942f20c84dce142cd2eeafd44ca7362#ec4f92941942f20c84dce142cd2eeafd44ca7362" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf5c871191e5fbbaa58af5ab7cb037f792e28297#cf5c871191e5fbbaa58af5ab7cb037f792e28297" dependencies = [ "anyhow", "arc-swap", @@ -2125,7 +2130,7 @@ dependencies = [ [[package]] name = "collab-entity" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=ec4f92941942f20c84dce142cd2eeafd44ca7362#ec4f92941942f20c84dce142cd2eeafd44ca7362" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf5c871191e5fbbaa58af5ab7cb037f792e28297#cf5c871191e5fbbaa58af5ab7cb037f792e28297" dependencies = [ "anyhow", "bytes", @@ -2144,14 +2149,14 @@ dependencies = [ [[package]] name = "collab-folder" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=ec4f92941942f20c84dce142cd2eeafd44ca7362#ec4f92941942f20c84dce142cd2eeafd44ca7362" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf5c871191e5fbbaa58af5ab7cb037f792e28297#cf5c871191e5fbbaa58af5ab7cb037f792e28297" dependencies = [ "anyhow", "arc-swap", "chrono", "collab", "collab-entity", - "dashmap", + "dashmap 5.5.3", "getrandom 0.2.15", "serde", "serde_json", @@ -2228,7 +2233,7 @@ dependencies = [ [[package]] name = "collab-user" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=ec4f92941942f20c84dce142cd2eeafd44ca7362#ec4f92941942f20c84dce142cd2eeafd44ca7362" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf5c871191e5fbbaa58af5ab7cb037f792e28297#cf5c871191e5fbbaa58af5ab7cb037f792e28297" dependencies = [ "anyhow", "collab", @@ -2668,6 +2673,20 @@ dependencies = [ "parking_lot_core 0.9.10", ] +[[package]] +name = "dashmap" +version = "6.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core 0.9.10", +] + [[package]] name = "data-encoding" version = "2.6.0" @@ -2971,6 +2990,16 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "event-listener-strategy" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +dependencies = [ + "event-listener", + "pin-project-lite", +] + [[package]] name = "fancy-regex" version = "0.11.0" @@ -3328,7 +3357,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68a7f542ee6b35af73b06abc0dad1c1bae89964e4e253bc4b587b91c9637867b" dependencies = [ "cfg-if 1.0.0", - "dashmap", + "dashmap 5.5.3", "futures", "futures-timer", "no-std-compat", @@ -4198,7 +4227,7 @@ checksum = "c325dfab65f261f386debee8b0969da215b3fa0037e74c8a1234db7ba986d803" dependencies = [ "crossbeam-channel", "crossbeam-utils", - "dashmap", + "dashmap 5.5.3", "skeptic", "smallvec", "tagptr", @@ -8084,12 +8113,14 @@ dependencies = [ [[package]] name = "yrs" -version = "0.19.2" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8ca5126331b9a5ef5bb10f3f1c3d01b05f298d348c66f8fb15497d83ee73176" +checksum = "a8fc56b25e3aaf4b81a73f2a9a68ceae1e02d9005552e24058cfb9f96db73f33" dependencies = [ "arc-swap", - "atomic_refcell", + "async-lock", + "async-trait", + "dashmap 6.0.1", "fastrand", "serde", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index ca3bfc75..e0bad147 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -264,7 +264,7 @@ pgvector = { version = "0.4", features = ["sqlx"] } client-api-entity = { path = "libs/client-api-entity" } # collaboration -yrs = { version = "0.19.2", features = ["sync"] } +yrs = { version = "0.21.0", features = ["sync"] } collab = { version = "0.2.0" } collab-entity = { version = "0.2.0" } collab-folder = { version = "0.2.0" } @@ -283,11 +283,11 @@ debug = true [patch.crates-io] # It's diffcult to resovle different version with the same crate used in AppFlowy Frontend and the Client-API crate. # So using patch to workaround this issue. -collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "ec4f92941942f20c84dce142cd2eeafd44ca7362" } -collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "ec4f92941942f20c84dce142cd2eeafd44ca7362" } -collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "ec4f92941942f20c84dce142cd2eeafd44ca7362" } -collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "ec4f92941942f20c84dce142cd2eeafd44ca7362" } -collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "ec4f92941942f20c84dce142cd2eeafd44ca7362" } +collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf5c871191e5fbbaa58af5ab7cb037f792e28297" } +collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf5c871191e5fbbaa58af5ab7cb037f792e28297" } +collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf5c871191e5fbbaa58af5ab7cb037f792e28297" } +collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf5c871191e5fbbaa58af5ab7cb037f792e28297" } +collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf5c871191e5fbbaa58af5ab7cb037f792e28297" } [features] history = [] diff --git a/libs/client-api-test/src/test_client.rs b/libs/client-api-test/src/test_client.rs index 961c9a0b..abd84d53 100644 --- a/libs/client-api-test/src/test_client.rs +++ b/libs/client-api-test/src/test_client.rs @@ -132,11 +132,13 @@ impl TestClient { let collab = (*lock).borrow(); collab .get_awareness() - .clients() .iter() - .map(|(_a, json)| { - let user: UserId = serde_json::from_str(json).unwrap(); - user.uid + .flat_map(|(_a, client)| match &client.data { + None => None, + Some(json) => { + let user: UserId = serde_json::from_str(json).unwrap(); + Some(user.uid) + }, }) .collect() } diff --git a/script/client_api_deps_check.sh b/script/client_api_deps_check.sh index 37d3461f..32418955 100755 --- a/script/client_api_deps_check.sh +++ b/script/client_api_deps_check.sh @@ -3,7 +3,7 @@ # Generate the current dependency list cargo tree > current_deps.txt -BASELINE_COUNT=595 +BASELINE_COUNT=609 CURRENT_COUNT=$(cat current_deps.txt | wc -l) echo "Expected dependency count (baseline): $BASELINE_COUNT"