From c3114e5a39fd9e920ad2c59bef7b804e7165206e Mon Sep 17 00:00:00 2001 From: "Nathan.fooo" <86001920+appflowy@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:31:05 +0800 Subject: [PATCH] chore: bump client api (#6113) * chore: bump client api and collab --- frontend/appflowy_tauri/src-tauri/Cargo.lock | 40 +++++++++---------- frontend/appflowy_tauri/src-tauri/Cargo.toml | 16 ++++---- .../appflowy_web_app/src-tauri/Cargo.lock | 40 +++++++++---------- .../appflowy_web_app/src-tauri/Cargo.toml | 16 ++++---- frontend/rust-lib/Cargo.lock | 38 +++++++++--------- frontend/rust-lib/Cargo.toml | 18 ++++----- .../collab-integrate/src/collab_builder.rs | 2 +- .../rust-lib/flowy-database2/src/manager.rs | 35 ++++++++-------- .../src/services/calculations/controller.rs | 6 +-- .../src/services/database/database_editor.rs | 10 +++-- .../src/services/database/database_observe.rs | 2 +- .../src/services/database_view/layout_deps.rs | 2 +- .../services/database_view/view_operation.rs | 5 ++- .../src/services/database_view/views.rs | 9 ++--- .../src/services/filter/controller.rs | 7 ++-- .../src/services/sort/controller.rs | 6 +-- .../rust-lib/flowy-document/src/manager.rs | 2 +- frontend/rust-lib/flowy-folder/src/manager.rs | 2 +- .../rust-lib/flowy-folder/src/manager_init.rs | 2 +- .../flowy-folder/src/manager_observer.rs | 2 +- .../flowy-folder/src/manager_test_util.rs | 2 +- .../data_import/appflowy_data_import.rs | 6 +-- .../flowy-user/src/user_manager/manager.rs | 3 +- .../user_manager/manager_user_awareness.rs | 2 +- 24 files changed, 139 insertions(+), 134 deletions(-) diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.lock b/frontend/appflowy_tauri/src-tauri/Cargo.lock index 120f09266b..23a023ab9f 100644 --- a/frontend/appflowy_tauri/src-tauri/Cargo.lock +++ b/frontend/appflowy_tauri/src-tauri/Cargo.lock @@ -172,7 +172,7 @@ checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "app-error" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "bincode", @@ -192,7 +192,7 @@ dependencies = [ [[package]] name = "appflowy-ai-client" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "bytes", @@ -837,7 +837,7 @@ dependencies = [ [[package]] name = "client-api" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "again", "anyhow", @@ -888,7 +888,7 @@ dependencies = [ [[package]] name = "client-api-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "collab-entity", "collab-rt-entity", @@ -901,7 +901,7 @@ dependencies = [ [[package]] name = "client-websocket" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "futures-channel", "futures-util", @@ -975,7 +975,7 @@ dependencies = [ [[package]] name = "collab" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=49cf2206d7494bb3006402b807e7f171905213e3#49cf2206d7494bb3006402b807e7f171905213e3" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac#47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" dependencies = [ "anyhow", "arc-swap", @@ -1000,7 +1000,7 @@ dependencies = [ [[package]] name = "collab-database" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=49cf2206d7494bb3006402b807e7f171905213e3#49cf2206d7494bb3006402b807e7f171905213e3" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac#47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" dependencies = [ "anyhow", "async-trait", @@ -1029,7 +1029,7 @@ dependencies = [ [[package]] name = "collab-document" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=49cf2206d7494bb3006402b807e7f171905213e3#49cf2206d7494bb3006402b807e7f171905213e3" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac#47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" dependencies = [ "anyhow", "arc-swap", @@ -1049,7 +1049,7 @@ dependencies = [ [[package]] name = "collab-entity" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=49cf2206d7494bb3006402b807e7f171905213e3#49cf2206d7494bb3006402b807e7f171905213e3" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac#47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" dependencies = [ "anyhow", "bytes", @@ -1068,7 +1068,7 @@ dependencies = [ [[package]] name = "collab-folder" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=49cf2206d7494bb3006402b807e7f171905213e3#49cf2206d7494bb3006402b807e7f171905213e3" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac#47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" dependencies = [ "anyhow", "arc-swap", @@ -1111,7 +1111,7 @@ dependencies = [ [[package]] name = "collab-plugins" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=49cf2206d7494bb3006402b807e7f171905213e3#49cf2206d7494bb3006402b807e7f171905213e3" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac#47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" dependencies = [ "anyhow", "async-stream", @@ -1149,7 +1149,7 @@ dependencies = [ [[package]] name = "collab-rt-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "bincode", @@ -1174,7 +1174,7 @@ dependencies = [ [[package]] name = "collab-rt-protocol" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "async-trait", @@ -1191,7 +1191,7 @@ dependencies = [ [[package]] name = "collab-user" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=49cf2206d7494bb3006402b807e7f171905213e3#49cf2206d7494bb3006402b807e7f171905213e3" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac#47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" dependencies = [ "anyhow", "collab", @@ -1446,7 +1446,7 @@ dependencies = [ "cssparser-macros", "dtoa-short", "itoa 1.0.6", - "phf 0.8.0", + "phf 0.11.2", "smallvec", ] @@ -1571,7 +1571,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "database-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "app-error", @@ -3117,7 +3117,7 @@ dependencies = [ [[package]] name = "gotrue" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "futures-util", @@ -3134,7 +3134,7 @@ dependencies = [ [[package]] name = "gotrue-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "app-error", @@ -3566,7 +3566,7 @@ dependencies = [ [[package]] name = "infra" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "bytes", @@ -6169,7 +6169,7 @@ dependencies = [ [[package]] name = "shared-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "app-error", diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.toml b/frontend/appflowy_tauri/src-tauri/Cargo.toml index e0b98774a3..688f144a92 100644 --- a/frontend/appflowy_tauri/src-tauri/Cargo.toml +++ b/frontend/appflowy_tauri/src-tauri/Cargo.toml @@ -53,7 +53,7 @@ collab-user = { version = "0.2" } # Run the script: # scripts/tool/update_client_api_rev.sh new_rev_id # ⚠️⚠️⚠️️ -client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "c9504d4081a8d9893830dc6598429353b078271b" } +client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "52782033948b7d243693ca159ea519d53458c8a6" } [dependencies] serde_json.workspace = true @@ -116,13 +116,13 @@ custom-protocol = ["tauri/custom-protocol"] # To switch to the local path, run: # scripts/tool/update_collab_source.sh # ⚠️⚠️⚠️️ -collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "49cf2206d7494bb3006402b807e7f171905213e3" } -collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "49cf2206d7494bb3006402b807e7f171905213e3" } -collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "49cf2206d7494bb3006402b807e7f171905213e3" } -collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "49cf2206d7494bb3006402b807e7f171905213e3" } -collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "49cf2206d7494bb3006402b807e7f171905213e3" } -collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "49cf2206d7494bb3006402b807e7f171905213e3" } -collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "49cf2206d7494bb3006402b807e7f171905213e3" } +collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" } +collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" } +collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" } +collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" } +collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" } +collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" } +collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" } # Working directory: frontend # To update the commit ID, run: diff --git a/frontend/appflowy_web_app/src-tauri/Cargo.lock b/frontend/appflowy_web_app/src-tauri/Cargo.lock index 2cad4b1365..d8500665d9 100644 --- a/frontend/appflowy_web_app/src-tauri/Cargo.lock +++ b/frontend/appflowy_web_app/src-tauri/Cargo.lock @@ -163,7 +163,7 @@ checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "app-error" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "bincode", @@ -183,7 +183,7 @@ dependencies = [ [[package]] name = "appflowy-ai-client" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "bytes", @@ -811,7 +811,7 @@ dependencies = [ [[package]] name = "client-api" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "again", "anyhow", @@ -862,7 +862,7 @@ dependencies = [ [[package]] name = "client-api-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "collab-entity", "collab-rt-entity", @@ -875,7 +875,7 @@ dependencies = [ [[package]] name = "client-websocket" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "futures-channel", "futures-util", @@ -958,7 +958,7 @@ dependencies = [ [[package]] name = "collab" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=49cf2206d7494bb3006402b807e7f171905213e3#49cf2206d7494bb3006402b807e7f171905213e3" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac#47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" dependencies = [ "anyhow", "arc-swap", @@ -983,7 +983,7 @@ dependencies = [ [[package]] name = "collab-database" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=49cf2206d7494bb3006402b807e7f171905213e3#49cf2206d7494bb3006402b807e7f171905213e3" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac#47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" dependencies = [ "anyhow", "async-trait", @@ -1012,7 +1012,7 @@ dependencies = [ [[package]] name = "collab-document" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=49cf2206d7494bb3006402b807e7f171905213e3#49cf2206d7494bb3006402b807e7f171905213e3" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac#47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" dependencies = [ "anyhow", "arc-swap", @@ -1032,7 +1032,7 @@ dependencies = [ [[package]] name = "collab-entity" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=49cf2206d7494bb3006402b807e7f171905213e3#49cf2206d7494bb3006402b807e7f171905213e3" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac#47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" dependencies = [ "anyhow", "bytes", @@ -1051,7 +1051,7 @@ dependencies = [ [[package]] name = "collab-folder" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=49cf2206d7494bb3006402b807e7f171905213e3#49cf2206d7494bb3006402b807e7f171905213e3" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac#47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" dependencies = [ "anyhow", "arc-swap", @@ -1094,7 +1094,7 @@ dependencies = [ [[package]] name = "collab-plugins" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=49cf2206d7494bb3006402b807e7f171905213e3#49cf2206d7494bb3006402b807e7f171905213e3" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac#47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" dependencies = [ "anyhow", "async-stream", @@ -1132,7 +1132,7 @@ dependencies = [ [[package]] name = "collab-rt-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "bincode", @@ -1157,7 +1157,7 @@ dependencies = [ [[package]] name = "collab-rt-protocol" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "async-trait", @@ -1174,7 +1174,7 @@ dependencies = [ [[package]] name = "collab-user" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=49cf2206d7494bb3006402b807e7f171905213e3#49cf2206d7494bb3006402b807e7f171905213e3" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac#47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" dependencies = [ "anyhow", "collab", @@ -1436,7 +1436,7 @@ dependencies = [ "cssparser-macros", "dtoa-short", "itoa 1.0.10", - "phf 0.8.0", + "phf 0.11.2", "smallvec", ] @@ -1561,7 +1561,7 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "database-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "app-error", @@ -3184,7 +3184,7 @@ dependencies = [ [[package]] name = "gotrue" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "futures-util", @@ -3201,7 +3201,7 @@ dependencies = [ [[package]] name = "gotrue-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "app-error", @@ -3638,7 +3638,7 @@ dependencies = [ [[package]] name = "infra" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "bytes", @@ -6233,7 +6233,7 @@ dependencies = [ [[package]] name = "shared-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "app-error", diff --git a/frontend/appflowy_web_app/src-tauri/Cargo.toml b/frontend/appflowy_web_app/src-tauri/Cargo.toml index 2db7456f50..68a7ba82e1 100644 --- a/frontend/appflowy_web_app/src-tauri/Cargo.toml +++ b/frontend/appflowy_web_app/src-tauri/Cargo.toml @@ -52,7 +52,7 @@ collab-user = { version = "0.2" } # Run the script: # scripts/tool/update_client_api_rev.sh new_rev_id # ⚠️⚠️⚠️️ -client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "c9504d4081a8d9893830dc6598429353b078271b" } +client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "52782033948b7d243693ca159ea519d53458c8a6" } [dependencies] serde_json.workspace = true @@ -116,13 +116,13 @@ custom-protocol = ["tauri/custom-protocol"] # To switch to the local path, run: # scripts/tool/update_collab_source.sh # ⚠️⚠️⚠️️ -collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "49cf2206d7494bb3006402b807e7f171905213e3" } -collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "49cf2206d7494bb3006402b807e7f171905213e3" } -collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "49cf2206d7494bb3006402b807e7f171905213e3" } -collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "49cf2206d7494bb3006402b807e7f171905213e3" } -collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "49cf2206d7494bb3006402b807e7f171905213e3" } -collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "49cf2206d7494bb3006402b807e7f171905213e3" } -collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "49cf2206d7494bb3006402b807e7f171905213e3" } +collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" } +collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" } +collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" } +collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" } +collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" } +collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" } +collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" } # Working directory: frontend # To update the commit ID, run: diff --git a/frontend/rust-lib/Cargo.lock b/frontend/rust-lib/Cargo.lock index 8acf6c8b53..7130ab9809 100644 --- a/frontend/rust-lib/Cargo.lock +++ b/frontend/rust-lib/Cargo.lock @@ -163,7 +163,7 @@ checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "app-error" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "bincode", @@ -183,7 +183,7 @@ dependencies = [ [[package]] name = "appflowy-ai-client" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "bytes", @@ -729,7 +729,7 @@ dependencies = [ [[package]] name = "client-api" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "again", "anyhow", @@ -780,7 +780,7 @@ dependencies = [ [[package]] name = "client-api-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "collab-entity", "collab-rt-entity", @@ -793,7 +793,7 @@ dependencies = [ [[package]] name = "client-websocket" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "futures-channel", "futures-util", @@ -836,7 +836,7 @@ dependencies = [ [[package]] name = "collab" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=49cf2206d7494bb3006402b807e7f171905213e3#49cf2206d7494bb3006402b807e7f171905213e3" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac#47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" dependencies = [ "anyhow", "arc-swap", @@ -861,7 +861,7 @@ dependencies = [ [[package]] name = "collab-database" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=49cf2206d7494bb3006402b807e7f171905213e3#49cf2206d7494bb3006402b807e7f171905213e3" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac#47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" dependencies = [ "anyhow", "async-trait", @@ -890,7 +890,7 @@ dependencies = [ [[package]] name = "collab-document" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=49cf2206d7494bb3006402b807e7f171905213e3#49cf2206d7494bb3006402b807e7f171905213e3" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac#47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" dependencies = [ "anyhow", "arc-swap", @@ -910,7 +910,7 @@ dependencies = [ [[package]] name = "collab-entity" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=49cf2206d7494bb3006402b807e7f171905213e3#49cf2206d7494bb3006402b807e7f171905213e3" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac#47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" dependencies = [ "anyhow", "bytes", @@ -929,7 +929,7 @@ dependencies = [ [[package]] name = "collab-folder" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=49cf2206d7494bb3006402b807e7f171905213e3#49cf2206d7494bb3006402b807e7f171905213e3" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac#47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" dependencies = [ "anyhow", "arc-swap", @@ -972,7 +972,7 @@ dependencies = [ [[package]] name = "collab-plugins" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=49cf2206d7494bb3006402b807e7f171905213e3#49cf2206d7494bb3006402b807e7f171905213e3" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac#47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" dependencies = [ "anyhow", "async-stream", @@ -1010,7 +1010,7 @@ dependencies = [ [[package]] name = "collab-rt-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "bincode", @@ -1035,7 +1035,7 @@ dependencies = [ [[package]] name = "collab-rt-protocol" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "async-trait", @@ -1052,7 +1052,7 @@ dependencies = [ [[package]] name = "collab-user" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=49cf2206d7494bb3006402b807e7f171905213e3#49cf2206d7494bb3006402b807e7f171905213e3" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac#47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" dependencies = [ "anyhow", "collab", @@ -1395,7 +1395,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "database-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "app-error", @@ -2795,7 +2795,7 @@ dependencies = [ [[package]] name = "gotrue" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "futures-util", @@ -2812,7 +2812,7 @@ dependencies = [ [[package]] name = "gotrue-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "app-error", @@ -3177,7 +3177,7 @@ dependencies = [ [[package]] name = "infra" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "bytes", @@ -5377,7 +5377,7 @@ dependencies = [ [[package]] name = "shared-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=c9504d4081a8d9893830dc6598429353b078271b#c9504d4081a8d9893830dc6598429353b078271b" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=52782033948b7d243693ca159ea519d53458c8a6#52782033948b7d243693ca159ea519d53458c8a6" dependencies = [ "anyhow", "app-error", diff --git a/frontend/rust-lib/Cargo.toml b/frontend/rust-lib/Cargo.toml index 4d9a5ed452..6f49a2fd39 100644 --- a/frontend/rust-lib/Cargo.toml +++ b/frontend/rust-lib/Cargo.toml @@ -100,8 +100,8 @@ dashmap = "6.0.1" # Run the script.add_workspace_members: # scripts/tool/update_client_api_rev.sh new_rev_id # ⚠️⚠️⚠️️ -client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "c9504d4081a8d9893830dc6598429353b078271b" } -client-api-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "c9504d4081a8d9893830dc6598429353b078271b" } +client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "52782033948b7d243693ca159ea519d53458c8a6" } +client-api-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "52782033948b7d243693ca159ea519d53458c8a6" } [profile.dev] opt-level = 0 @@ -136,13 +136,13 @@ rocksdb = { git = "https://github.com/rust-rocksdb/rust-rocksdb", rev = "1710120 # To switch to the local path, run: # scripts/tool/update_collab_source.sh # ⚠️⚠️⚠️️ -collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "49cf2206d7494bb3006402b807e7f171905213e3" } -collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "49cf2206d7494bb3006402b807e7f171905213e3" } -collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "49cf2206d7494bb3006402b807e7f171905213e3" } -collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "49cf2206d7494bb3006402b807e7f171905213e3" } -collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "49cf2206d7494bb3006402b807e7f171905213e3" } -collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "49cf2206d7494bb3006402b807e7f171905213e3" } -collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "49cf2206d7494bb3006402b807e7f171905213e3" } +collab = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" } +collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" } +collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" } +collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" } +collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" } +collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" } +collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "47dbd6c8033f8fd2999cb8d11f2d60ede121a0ac" } # Working directory: frontend # To update the commit ID, run: diff --git a/frontend/rust-lib/collab-integrate/src/collab_builder.rs b/frontend/rust-lib/collab-integrate/src/collab_builder.rs index 697a0467d3..1a8b1786ff 100644 --- a/frontend/rust-lib/collab-integrate/src/collab_builder.rs +++ b/frontend/rust-lib/collab-integrate/src/collab_builder.rs @@ -25,11 +25,11 @@ use collab_plugins::local_storage::indexeddb::IndexeddbDiskPlugin; } pub use crate::plugin_provider::CollabCloudPluginProvider; +use collab::lock::RwLock; use collab_plugins::local_storage::kv::doc::CollabKVAction; use collab_plugins::local_storage::kv::KVTransactionDB; use collab_plugins::local_storage::CollabPersistenceConfig; use collab_user::core::{UserAwareness, UserAwarenessNotifier}; -use tokio::sync::RwLock; use lib_infra::{if_native, if_wasm}; use tracing::{error, instrument, trace, warn}; diff --git a/frontend/rust-lib/flowy-database2/src/manager.rs b/frontend/rust-lib/flowy-database2/src/manager.rs index 3885a8d0e6..7f09840a44 100644 --- a/frontend/rust-lib/flowy-database2/src/manager.rs +++ b/frontend/rust-lib/flowy-database2/src/manager.rs @@ -6,6 +6,7 @@ use std::collections::HashMap; use std::sync::{Arc, Weak}; use collab::core::collab::DataSource; +use collab::lock::RwLock; use collab::preclude::Collab; use collab_database::database::{Database, DatabaseData}; use collab_database::entity::{CreateDatabaseParams, CreateViewParams}; @@ -20,7 +21,7 @@ use collab_entity::{CollabObject, CollabType, EncodedCollab}; use collab_plugins::local_storage::kv::KVTransactionDB; use dashmap::DashMap; use tokio::select; -use tokio::sync::{Mutex, RwLock}; +use tokio::sync::Mutex; use tokio_util::sync::CancellationToken; use tracing::{error, info, instrument, trace}; @@ -39,6 +40,7 @@ use crate::services::cell::stringify_cell; use crate::services::database::DatabaseEditor; use crate::services::database_view::DatabaseLayoutDepsResolver; use crate::services::field::translate_type_option::translate::TranslateTypeOption; +use tokio::sync::RwLock as TokioRwLock; use crate::services::field_settings::default_field_settings_by_layout_map; use crate::services::share::csv::{CSVFormat, CSVImporter, ImportResult}; @@ -53,7 +55,7 @@ pub trait DatabaseUser: Send + Sync { pub struct DatabaseManager { user: Arc, workspace_database: ArcSwapOption>, - task_scheduler: Arc>, + task_scheduler: Arc>, editors: Mutex>>, removing_editor: Arc>>>, collab_builder: Arc, @@ -64,7 +66,7 @@ pub struct DatabaseManager { impl DatabaseManager { pub fn new( database_user: Arc, - task_scheduler: Arc>, + task_scheduler: Arc>, collab_builder: Arc, cloud_service: Arc, ai_service: Arc, @@ -370,7 +372,7 @@ impl DatabaseManager { ) -> FlowyResult { let database_data = DatabaseData::from_json_bytes(data)?; - let mut create_database_params = CreateDatabaseParams::from_database_data(database_data); + let mut create_database_params = CreateDatabaseParams::from_database_data(database_data, None); let old_view_id = create_database_params.inline_view_id.clone(); create_database_params.inline_view_id = view_id.to_string(); @@ -906,27 +908,26 @@ impl DatabaseCollabPersistenceService for DatabasePersistenceImpl { } } - fn flush_collab( + fn flush_collabs( &self, - object_id: &str, - encode_collab: EncodedCollab, + encoded_collabs: Vec<(String, EncodedCollab)>, ) -> Result<(), DatabaseError> { let uid = self .user .user_id() .map_err(|err| DatabaseError::Internal(err.into()))?; if let Ok(Some(collab_db)) = self.user.collab_db(uid).map(|weak| weak.upgrade()) { - trace!("[Database]: flush collab:{}", object_id); let write_txn = collab_db.write_txn(); - write_txn - .flush_doc( - uid, - object_id, - encode_collab.state_vector.to_vec(), - encode_collab.doc_state.to_vec(), - ) - .map_err(|err| DatabaseError::Internal(anyhow!("failed to flush doc: {}", err)))?; - + for (object_id, encode_collab) in encoded_collabs { + write_txn + .flush_doc( + uid, + &object_id, + encode_collab.state_vector.to_vec(), + encode_collab.doc_state.to_vec(), + ) + .map_err(|err| DatabaseError::Internal(anyhow!("failed to flush doc: {}", err)))?; + } write_txn .commit_transaction() .map_err(|err| DatabaseError::Internal(anyhow!("failed to commit transaction: {}", err)))?; diff --git a/frontend/rust-lib/flowy-database2/src/services/calculations/controller.rs b/frontend/rust-lib/flowy-database2/src/services/calculations/controller.rs index ad6cb71e6d..865c8a22c5 100644 --- a/frontend/rust-lib/flowy-database2/src/services/calculations/controller.rs +++ b/frontend/rust-lib/flowy-database2/src/services/calculations/controller.rs @@ -6,7 +6,7 @@ use collab_database::fields::Field; use collab_database::rows::{Row, RowCell}; use flowy_error::FlowyResult; use serde::{Deserialize, Serialize}; -use tokio::sync::RwLock; +use tokio::sync::RwLock as TokioRwLock; use lib_infra::priority_task::{QualityOfService, Task, TaskContent, TaskDispatcher}; @@ -34,7 +34,7 @@ pub struct CalculationsController { handler_id: String, delegate: Box, calculations_by_field_cache: CalculationsByFieldIdCache, - task_scheduler: Arc>, + task_scheduler: Arc>, calculations_service: CalculationsService, notifier: DatabaseViewChangedNotifier, } @@ -51,7 +51,7 @@ impl CalculationsController { handler_id: &str, delegate: T, calculations: Vec>, - task_scheduler: Arc>, + task_scheduler: Arc>, notifier: DatabaseViewChangedNotifier, ) -> Self where diff --git a/frontend/rust-lib/flowy-database2/src/services/database/database_editor.rs b/frontend/rust-lib/flowy-database2/src/services/database/database_editor.rs index 043e2ceb24..c10cd12045 100644 --- a/frontend/rust-lib/flowy-database2/src/services/database/database_editor.rs +++ b/frontend/rust-lib/flowy-database2/src/services/database/database_editor.rs @@ -22,6 +22,7 @@ use crate::utils::cache::AnyTypeCache; use crate::DatabaseUser; use arc_swap::ArcSwap; use async_trait::async_trait; +use collab::lock::RwLock; use collab_database::database::Database; use collab_database::entity::DatabaseView; use collab_database::fields::{Field, TypeOptionData}; @@ -40,7 +41,8 @@ use lib_infra::util::timestamp; use std::collections::HashMap; use std::sync::Arc; use std::time::Duration; -use tokio::sync::{broadcast, oneshot, RwLock}; +use tokio::sync::RwLock as TokioRwLock; +use tokio::sync::{broadcast, oneshot}; use tokio_util::sync::CancellationToken; use tracing::{debug, error, event, info, instrument, trace, warn}; @@ -66,7 +68,7 @@ impl DatabaseEditor { pub async fn new( user: Arc, database: Arc>, - task_scheduler: Arc>, + task_scheduler: Arc>, collab_builder: Arc, ) -> FlowyResult> { let notification_sender = Arc::new(DebounceNotificationSender::new(200)); @@ -1576,7 +1578,7 @@ impl DatabaseEditor { struct DatabaseViewOperationImpl { database: Arc>, - task_scheduler: Arc>, + task_scheduler: Arc>, cell_cache: CellCache, editor_by_view_id: Arc>, database_cancellation: Arc>>, @@ -1860,7 +1862,7 @@ impl DatabaseViewOperation for DatabaseViewOperationImpl { .update_layout_type(view_id, layout_type); } - fn get_task_scheduler(&self) -> Arc> { + fn get_task_scheduler(&self) -> Arc> { self.task_scheduler.clone() } diff --git a/frontend/rust-lib/flowy-database2/src/services/database/database_observe.rs b/frontend/rust-lib/flowy-database2/src/services/database/database_observe.rs index 9bbb6bbb47..038f5a12ce 100644 --- a/frontend/rust-lib/flowy-database2/src/services/database/database_observe.rs +++ b/frontend/rust-lib/flowy-database2/src/services/database/database_observe.rs @@ -1,6 +1,7 @@ use crate::entities::{DatabaseSyncStatePB, DidFetchRowPB, RowsChangePB}; use crate::notification::{send_notification, DatabaseNotification, DATABASE_OBSERVABLE_SOURCE}; use crate::services::database::{DatabaseEditor, UpdatedRow}; +use collab::lock::RwLock; use collab_database::blocks::BlockEvent; use collab_database::database::Database; use collab_database::fields::FieldChange; @@ -10,7 +11,6 @@ use flowy_notification::{DebounceNotificationSender, NotificationBuilder}; use futures::StreamExt; use lib_dispatch::prelude::af_spawn; use std::sync::Arc; -use tokio::sync::RwLock; use tracing::{trace, warn}; pub(crate) async fn observe_sync_state(database_id: &str, database: &Arc>) { diff --git a/frontend/rust-lib/flowy-database2/src/services/database_view/layout_deps.rs b/frontend/rust-lib/flowy-database2/src/services/database_view/layout_deps.rs index d337c5002e..fa2d58fbae 100644 --- a/frontend/rust-lib/flowy-database2/src/services/database_view/layout_deps.rs +++ b/frontend/rust-lib/flowy-database2/src/services/database_view/layout_deps.rs @@ -1,10 +1,10 @@ +use collab::lock::RwLock; use collab_database::database::{gen_field_id, Database}; use collab_database::fields::Field; use collab_database::views::{ DatabaseLayout, FieldSettingsByFieldIdMap, LayoutSetting, OrderObjectPosition, }; use std::sync::Arc; -use tokio::sync::RwLock; use crate::entities::FieldType; use crate::services::field::{DateTypeOption, SingleSelectTypeOption}; diff --git a/frontend/rust-lib/flowy-database2/src/services/database_view/view_operation.rs b/frontend/rust-lib/flowy-database2/src/services/database_view/view_operation.rs index c10b5c53e5..8de209a956 100644 --- a/frontend/rust-lib/flowy-database2/src/services/database_view/view_operation.rs +++ b/frontend/rust-lib/flowy-database2/src/services/database_view/view_operation.rs @@ -1,4 +1,5 @@ use async_trait::async_trait; +use collab::lock::RwLock; use collab_database::database::Database; use collab_database::entity::DatabaseView; use collab_database::fields::{Field, TypeOptionData}; @@ -6,7 +7,7 @@ use collab_database::rows::{Row, RowCell, RowDetail, RowId}; use collab_database::views::{DatabaseLayout, LayoutSetting}; use std::collections::HashMap; use std::sync::Arc; -use tokio::sync::RwLock; +use tokio::sync::RwLock as TokioRwLock; use flowy_error::FlowyError; use lib_infra::priority_task::TaskDispatcher; @@ -118,7 +119,7 @@ pub trait DatabaseViewOperation: Send + Sync + 'static { async fn update_layout_type(&self, view_id: &str, layout_type: &DatabaseLayout); /// Returns a `TaskDispatcher` used to poll a `Task` - fn get_task_scheduler(&self) -> Arc>; + fn get_task_scheduler(&self) -> Arc>; fn get_type_option_cell_handler( &self, diff --git a/frontend/rust-lib/flowy-database2/src/services/database_view/views.rs b/frontend/rust-lib/flowy-database2/src/services/database_view/views.rs index 445257a8b9..3d460df63c 100644 --- a/frontend/rust-lib/flowy-database2/src/services/database_view/views.rs +++ b/frontend/rust-lib/flowy-database2/src/services/database_view/views.rs @@ -2,14 +2,13 @@ use collab_database::database::Database; use std::collections::HashMap; use std::sync::Arc; -use nanoid::nanoid; -use tokio::sync::{broadcast, RwLock}; - -use flowy_error::FlowyResult; - use crate::services::cell::CellCache; use crate::services::database::DatabaseRowEvent; use crate::services::database_view::{DatabaseViewEditor, DatabaseViewOperation}; +use collab::lock::RwLock; +use flowy_error::FlowyResult; +use nanoid::nanoid; +use tokio::sync::broadcast; pub type RowEventSender = broadcast::Sender; pub type RowEventReceiver = broadcast::Receiver; diff --git a/frontend/rust-lib/flowy-database2/src/services/filter/controller.rs b/frontend/rust-lib/flowy-database2/src/services/filter/controller.rs index cb3231f948..e033c13074 100644 --- a/frontend/rust-lib/flowy-database2/src/services/filter/controller.rs +++ b/frontend/rust-lib/flowy-database2/src/services/filter/controller.rs @@ -3,6 +3,7 @@ use std::collections::HashMap; use std::str::FromStr; use std::sync::Arc; +use collab::lock::RwLock; use collab_database::database::gen_database_filter_id; use collab_database::fields::Field; use collab_database::rows::{Cell, Cells, Row, RowDetail, RowId}; @@ -10,7 +11,7 @@ use dashmap::DashMap; use flowy_error::FlowyResult; use lib_infra::priority_task::{QualityOfService, Task, TaskContent, TaskDispatcher}; use serde::{Deserialize, Serialize}; -use tokio::sync::RwLock; +use tokio::sync::RwLock as TokioRwLock; use tracing::{error, trace}; use crate::entities::filter_entities::*; @@ -41,7 +42,7 @@ pub struct FilterController { result_by_row_id: DashMap, cell_cache: CellCache, filters: RwLock>, - task_scheduler: Arc>, + task_scheduler: Arc>, notifier: DatabaseViewChangedNotifier, } @@ -56,7 +57,7 @@ impl FilterController { view_id: &str, handler_id: &str, delegate: T, - task_scheduler: Arc>, + task_scheduler: Arc>, cell_cache: CellCache, notifier: DatabaseViewChangedNotifier, ) -> Self diff --git a/frontend/rust-lib/flowy-database2/src/services/sort/controller.rs b/frontend/rust-lib/flowy-database2/src/services/sort/controller.rs index 782ba06d9e..7c19ca5da4 100644 --- a/frontend/rust-lib/flowy-database2/src/services/sort/controller.rs +++ b/frontend/rust-lib/flowy-database2/src/services/sort/controller.rs @@ -8,7 +8,7 @@ use collab_database::fields::Field; use collab_database::rows::{Cell, Row, RowId}; use rayon::prelude::ParallelSliceMut; use serde::{Deserialize, Serialize}; -use tokio::sync::RwLock; +use tokio::sync::RwLock as TokioRwLock; use flowy_error::FlowyResult; use lib_infra::priority_task::{QualityOfService, Task, TaskContent, TaskDispatcher}; @@ -38,7 +38,7 @@ pub struct SortController { view_id: String, handler_id: String, delegate: Box, - task_scheduler: Arc>, + task_scheduler: Arc>, sorts: Vec>, cell_cache: CellCache, row_index_cache: HashMap, @@ -57,7 +57,7 @@ impl SortController { handler_id: &str, sorts: Vec>, delegate: T, - task_scheduler: Arc>, + task_scheduler: Arc>, cell_cache: CellCache, notifier: DatabaseViewChangedNotifier, ) -> Self diff --git a/frontend/rust-lib/flowy-document/src/manager.rs b/frontend/rust-lib/flowy-document/src/manager.rs index 8eadf2b55f..ee4bf64785 100644 --- a/frontend/rust-lib/flowy-document/src/manager.rs +++ b/frontend/rust-lib/flowy-document/src/manager.rs @@ -4,6 +4,7 @@ use std::sync::Weak; use collab::core::collab::DataSource; use collab::core::origin::CollabOrigin; use collab::entity::EncodedCollab; +use collab::lock::RwLock; use collab::preclude::Collab; use collab_document::blocks::DocumentData; use collab_document::conversions::convert_document_to_plain_text; @@ -17,7 +18,6 @@ use collab_plugins::local_storage::kv::KVTransactionDB; use collab_plugins::CollabKVDB; use dashmap::DashMap; use lib_infra::util::timestamp; -use tokio::sync::RwLock; use tracing::trace; use tracing::{event, instrument}; diff --git a/frontend/rust-lib/flowy-folder/src/manager.rs b/frontend/rust-lib/flowy-folder/src/manager.rs index 173ffbd4c3..8e2ab46d04 100644 --- a/frontend/rust-lib/flowy-folder/src/manager.rs +++ b/frontend/rust-lib/flowy-folder/src/manager.rs @@ -22,6 +22,7 @@ use crate::view_operation::{ }; use arc_swap::ArcSwapOption; use collab::core::collab::DataSource; +use collab::lock::RwLock; use collab_entity::{CollabType, EncodedCollab}; use collab_folder::{ Folder, FolderData, FolderNotify, Section, SectionItem, TrashInfo, View, ViewLayout, ViewUpdate, @@ -44,7 +45,6 @@ use futures::future; use std::collections::HashMap; use std::fmt::{Display, Formatter}; use std::sync::{Arc, Weak}; -use tokio::sync::RwLock; use tracing::{error, info, instrument}; pub trait FolderUser: Send + Sync { diff --git a/frontend/rust-lib/flowy-folder/src/manager_init.rs b/frontend/rust-lib/flowy-folder/src/manager_init.rs index cd1c45882e..cec6e56dc7 100644 --- a/frontend/rust-lib/flowy-folder/src/manager_init.rs +++ b/frontend/rust-lib/flowy-folder/src/manager_init.rs @@ -2,12 +2,12 @@ use crate::manager::{FolderInitDataSource, FolderManager}; use crate::manager_observer::*; use crate::user_default::DefaultFolderBuilder; use collab::core::collab::DataSource; +use collab::lock::RwLock; use collab_entity::{CollabType, EncodedCollab}; use collab_folder::{Folder, FolderNotify}; use collab_integrate::CollabKVDB; use flowy_error::{FlowyError, FlowyResult}; use std::sync::{Arc, Weak}; -use tokio::sync::RwLock; use tokio::task::spawn_blocking; use tracing::{event, info, Level}; diff --git a/frontend/rust-lib/flowy-folder/src/manager_observer.rs b/frontend/rust-lib/flowy-folder/src/manager_observer.rs index e196f492f9..8c8af3f0bb 100644 --- a/frontend/rust-lib/flowy-folder/src/manager_observer.rs +++ b/frontend/rust-lib/flowy-folder/src/manager_observer.rs @@ -5,6 +5,7 @@ use crate::entities::{ use crate::manager::{get_workspace_private_view_pbs, get_workspace_public_view_pbs, FolderUser}; use crate::notification::{send_notification, FolderNotification}; use collab::core::collab_state::SyncState; +use collab::lock::RwLock; use collab_folder::{ Folder, SectionChange, SectionChangeReceiver, TrashSectionChange, View, ViewChange, ViewChangeReceiver, @@ -12,7 +13,6 @@ use collab_folder::{ use lib_dispatch::prelude::af_spawn; use std::collections::HashSet; use std::sync::Weak; -use tokio::sync::RwLock; use tokio_stream::wrappers::WatchStream; use tokio_stream::StreamExt; use tracing::{event, trace, Level}; diff --git a/frontend/rust-lib/flowy-folder/src/manager_test_util.rs b/frontend/rust-lib/flowy-folder/src/manager_test_util.rs index 37e86d5867..e7c29f6d58 100644 --- a/frontend/rust-lib/flowy-folder/src/manager_test_util.rs +++ b/frontend/rust-lib/flowy-folder/src/manager_test_util.rs @@ -1,11 +1,11 @@ use crate::manager::{FolderManager, FolderUser}; use crate::view_operation::FolderOperationHandlers; +use collab::lock::RwLock; use collab_folder::Folder; use collab_integrate::collab_builder::AppFlowyCollabBuilder; use flowy_folder_pub::cloud::FolderCloudService; use flowy_search_pub::entities::FolderIndexManager; use std::sync::Arc; -use tokio::sync::RwLock; impl FolderManager { pub fn get_mutex_folder(&self) -> Option>> { diff --git a/frontend/rust-lib/flowy-user/src/services/data_import/appflowy_data_import.rs b/frontend/rust-lib/flowy-user/src/services/data_import/appflowy_data_import.rs index f05750c1f9..5f03cd537f 100644 --- a/frontend/rust-lib/flowy-user/src/services/data_import/appflowy_data_import.rs +++ b/frontend/rust-lib/flowy-user/src/services/data_import/appflowy_data_import.rs @@ -14,7 +14,7 @@ use collab_database::database::{ is_database_collab, mut_database_views_with_collab, reset_inline_view_id, }; use collab_database::rows::{database_row_document_id_from_row_id, mut_row_with_collab, RowId}; -use collab_database::workspace_database::DatabaseMetaList; +use collab_database::workspace_database::WorkspaceDatabaseBody; use collab_document::document_data::default_document_collab_data; use collab_entity::CollabType; use collab_folder::{Folder, UserId, View, ViewIdentifier, ViewLayout}; @@ -353,7 +353,7 @@ where &mut imported_database_indexer.transact_mut(), )?; - let array = DatabaseMetaList::new(&mut imported_database_indexer); + let array = WorkspaceDatabaseBody::new(&mut imported_database_indexer); for database_meta_list in array.get_all_database_meta(&imported_database_indexer.transact()) { database_view_ids_by_database_id.insert( old_to_new_id_map.exchange_new_id(&database_meta_list.database_id), @@ -403,7 +403,7 @@ where let new_uid = new_user_session.user_id; let new_object_id = &new_user_session.user_workspace.database_indexer_id; - let array = DatabaseMetaList::new(&mut database_with_views_collab); + let array = WorkspaceDatabaseBody::new(&mut database_with_views_collab); let mut txn = database_with_views_collab.transact_mut(); for database_meta in array.get_all_database_meta(&txn) { array.update_database(&mut txn, &database_meta.database_id, |update| { diff --git a/frontend/rust-lib/flowy-user/src/user_manager/manager.rs b/frontend/rust-lib/flowy-user/src/user_manager/manager.rs index 1b38599814..6f198de1ef 100644 --- a/frontend/rust-lib/flowy-user/src/user_manager/manager.rs +++ b/frontend/rust-lib/flowy-user/src/user_manager/manager.rs @@ -3,6 +3,7 @@ use collab_integrate::CollabKVDB; use flowy_error::{internal_error, ErrorCode, FlowyResult}; use arc_swap::ArcSwapOption; +use collab::lock::RwLock; use collab_user::core::UserAwareness; use dashmap::DashMap; use flowy_server_pub::AuthenticatorType; @@ -18,7 +19,7 @@ use serde_json::Value; use std::string::ToString; use std::sync::atomic::{AtomicI64, Ordering}; use std::sync::{Arc, Weak}; -use tokio::sync::{Mutex, RwLock}; +use tokio::sync::Mutex; use tokio_stream::StreamExt; use tracing::{debug, error, event, info, instrument, trace, warn}; diff --git a/frontend/rust-lib/flowy-user/src/user_manager/manager_user_awareness.rs b/frontend/rust-lib/flowy-user/src/user_manager/manager_user_awareness.rs index 224c91467a..0228edae50 100644 --- a/frontend/rust-lib/flowy-user/src/user_manager/manager_user_awareness.rs +++ b/frontend/rust-lib/flowy-user/src/user_manager/manager_user_awareness.rs @@ -2,6 +2,7 @@ use std::sync::{Arc, Weak}; use anyhow::Context; use collab::core::collab::DataSource; +use collab::lock::RwLock; use collab_entity::reminder::Reminder; use collab_entity::CollabType; use collab_integrate::collab_builder::{ @@ -9,7 +10,6 @@ use collab_integrate::collab_builder::{ }; use collab_user::core::{UserAwareness, UserAwarenessNotifier}; use dashmap::try_result::TryResult; -use tokio::sync::RwLock; use tracing::{error, info, instrument, trace}; use collab_integrate::CollabKVDB;