fix: doc open sync (#4732)

* chore: bump client api

* fix: open document and folder

* chore: bump collab rev

* chore: fix wasm build

* chore: fix warnings
This commit is contained in:
Nathan.fooo 2024-02-25 07:49:44 +08:00 committed by GitHub
parent 4ca3ba8e08
commit c3e5aa29fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
20 changed files with 295 additions and 221 deletions

View File

@ -162,7 +162,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
[[package]] [[package]]
name = "app-error" name = "app-error"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -714,7 +714,7 @@ dependencies = [
[[package]] [[package]]
name = "client-api" name = "client-api"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"again", "again",
"anyhow", "anyhow",
@ -733,6 +733,7 @@ dependencies = [
"gotrue", "gotrue",
"gotrue-entity", "gotrue-entity",
"governor", "governor",
"log",
"mime", "mime",
"mime_guess", "mime_guess",
"parking_lot 0.12.1", "parking_lot 0.12.1",
@ -817,7 +818,7 @@ dependencies = [
[[package]] [[package]]
name = "collab" name = "collab"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=195fabd025c3021ce0a42a3f76b8f2bad44cb45c#195fabd025c3021ce0a42a3f76b8f2bad44cb45c" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -839,7 +840,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-database" name = "collab-database"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=195fabd025c3021ce0a42a3f76b8f2bad44cb45c#195fabd025c3021ce0a42a3f76b8f2bad44cb45c" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -868,7 +869,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-document" name = "collab-document"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=195fabd025c3021ce0a42a3f76b8f2bad44cb45c#195fabd025c3021ce0a42a3f76b8f2bad44cb45c" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collab", "collab",
@ -887,7 +888,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-entity" name = "collab-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=195fabd025c3021ce0a42a3f76b8f2bad44cb45c#195fabd025c3021ce0a42a3f76b8f2bad44cb45c" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@ -902,7 +903,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-folder" name = "collab-folder"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=195fabd025c3021ce0a42a3f76b8f2bad44cb45c#195fabd025c3021ce0a42a3f76b8f2bad44cb45c" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chrono", "chrono",
@ -939,7 +940,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-plugins" name = "collab-plugins"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=195fabd025c3021ce0a42a3f76b8f2bad44cb45c#195fabd025c3021ce0a42a3f76b8f2bad44cb45c" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-stream", "async-stream",
@ -978,7 +979,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-user" name = "collab-user"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=195fabd025c3021ce0a42a3f76b8f2bad44cb45c#195fabd025c3021ce0a42a3f76b8f2bad44cb45c" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collab", "collab",
@ -1312,7 +1313,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
[[package]] [[package]]
name = "database-entity" name = "database-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -1909,6 +1910,7 @@ dependencies = [
"client-api", "client-api",
"collab-database", "collab-database",
"collab-document", "collab-document",
"collab-folder",
"collab-plugins", "collab-plugins",
"fancy-regex 0.11.0", "fancy-regex 0.11.0",
"flowy-codegen", "flowy-codegen",
@ -2584,7 +2586,7 @@ dependencies = [
[[package]] [[package]]
name = "gotrue" name = "gotrue"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"futures-util", "futures-util",
@ -2601,7 +2603,7 @@ dependencies = [
[[package]] [[package]]
name = "gotrue-entity" name = "gotrue-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -3056,7 +3058,7 @@ dependencies = [
[[package]] [[package]]
name = "infra" name = "infra"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"reqwest", "reqwest",
@ -4780,7 +4782,7 @@ dependencies = [
[[package]] [[package]]
name = "realtime-entity" name = "realtime-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -4794,6 +4796,7 @@ dependencies = [
"realtime-protocol", "realtime-protocol",
"serde", "serde",
"serde_json", "serde_json",
"serde_repr",
"thiserror", "thiserror",
"tokio-tungstenite", "tokio-tungstenite",
"websocket", "websocket",
@ -4803,7 +4806,7 @@ dependencies = [
[[package]] [[package]]
name = "realtime-protocol" name = "realtime-protocol"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -5451,7 +5454,7 @@ dependencies = [
[[package]] [[package]]
name = "shared-entity" name = "shared-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -6931,7 +6934,7 @@ checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc"
[[package]] [[package]]
name = "websocket" name = "websocket"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"futures-channel", "futures-channel",
"futures-util", "futures-util",
@ -7331,7 +7334,7 @@ dependencies = [
[[package]] [[package]]
name = "workspace-template" name = "workspace-template"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",

View File

@ -82,7 +82,7 @@ custom-protocol = ["tauri/custom-protocol"]
# Run the script: # Run the script:
# scripts/tool/update_client_api_rev.sh new_rev_id # scripts/tool/update_client_api_rev.sh new_rev_id
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "29a0851f485957cc6410ccf9d261c781c1d2f757" } client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" }
# Please use the following script to update collab. # Please use the following script to update collab.
# Working directory: frontend # Working directory: frontend
# #
@ -92,10 +92,10 @@ client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "29a
# To switch to the local path, run: # To switch to the local path, run:
# scripts/tool/update_collab_source.sh # scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "195fabd025c3021ce0a42a3f76b8f2bad44cb45c" } collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "195fabd025c3021ce0a42a3f76b8f2bad44cb45c" } collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "195fabd025c3021ce0a42a3f76b8f2bad44cb45c" } collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "195fabd025c3021ce0a42a3f76b8f2bad44cb45c" } collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "195fabd025c3021ce0a42a3f76b8f2bad44cb45c" } collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "195fabd025c3021ce0a42a3f76b8f2bad44cb45c" } collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "195fabd025c3021ce0a42a3f76b8f2bad44cb45c" } collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }

View File

@ -30,10 +30,10 @@ fn main() {
on_event(app_handler.clone(), event); on_event(app_handler.clone(), event);
}); });
}) })
.setup(|app| { .setup(|_app| {
#[cfg(debug_assertions)] #[cfg(debug_assertions)]
{ {
let window = app.get_window("main").unwrap(); let window = _app.get_window("main").unwrap();
window.open_devtools(); window.open_devtools();
} }
Ok(()) Ok(())

View File

@ -221,7 +221,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
[[package]] [[package]]
name = "app-error" name = "app-error"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -545,7 +545,7 @@ dependencies = [
[[package]] [[package]]
name = "client-api" name = "client-api"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"again", "again",
"anyhow", "anyhow",
@ -564,6 +564,7 @@ dependencies = [
"gotrue", "gotrue",
"gotrue-entity", "gotrue-entity",
"governor", "governor",
"log",
"mime", "mime",
"mime_guess", "mime_guess",
"parking_lot 0.12.1", "parking_lot 0.12.1",
@ -617,7 +618,7 @@ dependencies = [
[[package]] [[package]]
name = "collab" name = "collab"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=2de6d172f56fed29ee6f32b82040cca4867647ac#2de6d172f56fed29ee6f32b82040cca4867647ac" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=35c649ea201e12bf40f5352a8bf9c46141e013a5#35c649ea201e12bf40f5352a8bf9c46141e013a5"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -639,7 +640,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-document" name = "collab-document"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=2de6d172f56fed29ee6f32b82040cca4867647ac#2de6d172f56fed29ee6f32b82040cca4867647ac" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=35c649ea201e12bf40f5352a8bf9c46141e013a5#35c649ea201e12bf40f5352a8bf9c46141e013a5"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collab", "collab",
@ -658,7 +659,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-entity" name = "collab-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=2de6d172f56fed29ee6f32b82040cca4867647ac#2de6d172f56fed29ee6f32b82040cca4867647ac" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=35c649ea201e12bf40f5352a8bf9c46141e013a5#35c649ea201e12bf40f5352a8bf9c46141e013a5"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@ -673,7 +674,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-folder" name = "collab-folder"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=2de6d172f56fed29ee6f32b82040cca4867647ac#2de6d172f56fed29ee6f32b82040cca4867647ac" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=35c649ea201e12bf40f5352a8bf9c46141e013a5#35c649ea201e12bf40f5352a8bf9c46141e013a5"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chrono", "chrono",
@ -710,7 +711,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-plugins" name = "collab-plugins"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=2de6d172f56fed29ee6f32b82040cca4867647ac#2de6d172f56fed29ee6f32b82040cca4867647ac" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=35c649ea201e12bf40f5352a8bf9c46141e013a5#35c649ea201e12bf40f5352a8bf9c46141e013a5"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-stream", "async-stream",
@ -748,7 +749,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-user" name = "collab-user"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=2de6d172f56fed29ee6f32b82040cca4867647ac#2de6d172f56fed29ee6f32b82040cca4867647ac" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=35c649ea201e12bf40f5352a8bf9c46141e013a5#35c649ea201e12bf40f5352a8bf9c46141e013a5"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collab", "collab",
@ -945,7 +946,7 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5"
[[package]] [[package]]
name = "database-entity" name = "database-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -1698,7 +1699,7 @@ dependencies = [
[[package]] [[package]]
name = "gotrue" name = "gotrue"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"futures-util", "futures-util",
@ -1715,7 +1716,7 @@ dependencies = [
[[package]] [[package]]
name = "gotrue-entity" name = "gotrue-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -2049,7 +2050,7 @@ dependencies = [
[[package]] [[package]]
name = "infra" name = "infra"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"reqwest", "reqwest",
@ -3307,7 +3308,7 @@ dependencies = [
[[package]] [[package]]
name = "realtime-entity" name = "realtime-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -3321,6 +3322,7 @@ dependencies = [
"realtime-protocol", "realtime-protocol",
"serde", "serde",
"serde_json", "serde_json",
"serde_repr",
"thiserror", "thiserror",
"tokio-tungstenite", "tokio-tungstenite",
"websocket", "websocket",
@ -3330,7 +3332,7 @@ dependencies = [
[[package]] [[package]]
name = "realtime-protocol" name = "realtime-protocol"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -3777,7 +3779,7 @@ dependencies = [
[[package]] [[package]]
name = "shared-entity" name = "shared-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -4719,7 +4721,7 @@ checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10"
[[package]] [[package]]
name = "websocket" name = "websocket"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"futures-channel", "futures-channel",
"futures-util", "futures-util",
@ -5026,4 +5028,4 @@ dependencies = [
[[patch.unused]] [[patch.unused]]
name = "collab-database" name = "collab-database"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=2de6d172f56fed29ee6f32b82040cca4867647ac#2de6d172f56fed29ee6f32b82040cca4867647ac" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=35c649ea201e12bf40f5352a8bf9c46141e013a5#35c649ea201e12bf40f5352a8bf9c46141e013a5"

View File

@ -55,7 +55,7 @@ codegen-units = 1
# Run the script: # Run the script:
# scripts/tool/update_client_api_rev.sh new_rev_id # scripts/tool/update_client_api_rev.sh new_rev_id
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "29a0851f485957cc6410ccf9d261c781c1d2f757" } client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" }
# Please use the following script to update collab. # Please use the following script to update collab.
# Working directory: frontend # Working directory: frontend
# #
@ -65,10 +65,10 @@ client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "29a
# To switch to the local path, run: # To switch to the local path, run:
# scripts/tool/update_collab_source.sh # scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "195fabd025c3021ce0a42a3f76b8f2bad44cb45c" } collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "195fabd025c3021ce0a42a3f76b8f2bad44cb45c" } collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "195fabd025c3021ce0a42a3f76b8f2bad44cb45c" } collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "195fabd025c3021ce0a42a3f76b8f2bad44cb45c" } collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "195fabd025c3021ce0a42a3f76b8f2bad44cb45c" } collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "195fabd025c3021ce0a42a3f76b8f2bad44cb45c" } collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "195fabd025c3021ce0a42a3f76b8f2bad44cb45c" } collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }

View File

@ -55,7 +55,7 @@ impl CollabCloudPluginProvider for ServerProviderWASM {
CollabPluginProviderType::AppFlowyCloud CollabPluginProviderType::AppFlowyCloud
} }
fn get_plugins(&self, _context: CollabPluginProviderContext) -> Fut<Vec<Arc<dyn CollabPlugin>>> { fn get_plugins(&self, _context: CollabPluginProviderContext) -> Fut<Vec<Box<dyn CollabPlugin>>> {
to_fut(async move { vec![] }) to_fut(async move { vec![] })
} }

View File

@ -163,7 +163,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
[[package]] [[package]]
name = "app-error" name = "app-error"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -673,7 +673,7 @@ dependencies = [
[[package]] [[package]]
name = "client-api" name = "client-api"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"again", "again",
"anyhow", "anyhow",
@ -692,6 +692,7 @@ dependencies = [
"gotrue", "gotrue",
"gotrue-entity", "gotrue-entity",
"governor", "governor",
"log",
"mime", "mime",
"mime_guess", "mime_guess",
"parking_lot 0.12.1", "parking_lot 0.12.1",
@ -745,7 +746,7 @@ dependencies = [
[[package]] [[package]]
name = "collab" name = "collab"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=195fabd025c3021ce0a42a3f76b8f2bad44cb45c#195fabd025c3021ce0a42a3f76b8f2bad44cb45c" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -767,7 +768,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-database" name = "collab-database"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=195fabd025c3021ce0a42a3f76b8f2bad44cb45c#195fabd025c3021ce0a42a3f76b8f2bad44cb45c" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -796,7 +797,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-document" name = "collab-document"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=195fabd025c3021ce0a42a3f76b8f2bad44cb45c#195fabd025c3021ce0a42a3f76b8f2bad44cb45c" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collab", "collab",
@ -815,7 +816,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-entity" name = "collab-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=195fabd025c3021ce0a42a3f76b8f2bad44cb45c#195fabd025c3021ce0a42a3f76b8f2bad44cb45c" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@ -830,7 +831,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-folder" name = "collab-folder"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=195fabd025c3021ce0a42a3f76b8f2bad44cb45c#195fabd025c3021ce0a42a3f76b8f2bad44cb45c" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chrono", "chrono",
@ -867,7 +868,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-plugins" name = "collab-plugins"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=195fabd025c3021ce0a42a3f76b8f2bad44cb45c#195fabd025c3021ce0a42a3f76b8f2bad44cb45c" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-stream", "async-stream",
@ -906,7 +907,7 @@ dependencies = [
[[package]] [[package]]
name = "collab-user" name = "collab-user"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=195fabd025c3021ce0a42a3f76b8f2bad44cb45c#195fabd025c3021ce0a42a3f76b8f2bad44cb45c" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"collab", "collab",
@ -1236,7 +1237,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
[[package]] [[package]]
name = "database-entity" name = "database-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -1899,6 +1900,7 @@ dependencies = [
"client-api", "client-api",
"collab-database", "collab-database",
"collab-document", "collab-document",
"collab-folder",
"collab-plugins", "collab-plugins",
"fancy-regex 0.11.0", "fancy-regex 0.11.0",
"flowy-codegen", "flowy-codegen",
@ -2408,7 +2410,7 @@ dependencies = [
[[package]] [[package]]
name = "gotrue" name = "gotrue"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"futures-util", "futures-util",
@ -2425,7 +2427,7 @@ dependencies = [
[[package]] [[package]]
name = "gotrue-entity" name = "gotrue-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -2819,7 +2821,7 @@ dependencies = [
[[package]] [[package]]
name = "infra" name = "infra"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"reqwest", "reqwest",
@ -4295,7 +4297,7 @@ dependencies = [
[[package]] [[package]]
name = "realtime-entity" name = "realtime-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -4309,6 +4311,7 @@ dependencies = [
"realtime-protocol", "realtime-protocol",
"serde", "serde",
"serde_json", "serde_json",
"serde_repr",
"thiserror", "thiserror",
"tokio-tungstenite", "tokio-tungstenite",
"websocket", "websocket",
@ -4318,7 +4321,7 @@ dependencies = [
[[package]] [[package]]
name = "realtime-protocol" name = "realtime-protocol"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -4906,7 +4909,7 @@ dependencies = [
[[package]] [[package]]
name = "shared-entity" name = "shared-entity"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"app-error", "app-error",
@ -6081,7 +6084,7 @@ checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc"
[[package]] [[package]]
name = "websocket" name = "websocket"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"futures-channel", "futures-channel",
"futures-util", "futures-util",
@ -6302,7 +6305,7 @@ dependencies = [
[[package]] [[package]]
name = "workspace-template" name = "workspace-template"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=29a0851f485957cc6410ccf9d261c781c1d2f757#29a0851f485957cc6410ccf9d261c781c1d2f757" source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",

View File

@ -105,7 +105,7 @@ incremental = false
# Run the script: # Run the script:
# scripts/tool/update_client_api_rev.sh new_rev_id # scripts/tool/update_client_api_rev.sh new_rev_id
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "29a0851f485957cc6410ccf9d261c781c1d2f757" } client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" }
# Please use the following script to update collab. # Please use the following script to update collab.
# Working directory: frontend # Working directory: frontend
# #
@ -115,10 +115,10 @@ client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "29a
# To switch to the local path, run: # To switch to the local path, run:
# scripts/tool/update_collab_source.sh # scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️ # ⚠️⚠️⚠️️
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "195fabd025c3021ce0a42a3f76b8f2bad44cb45c" } collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "195fabd025c3021ce0a42a3f76b8f2bad44cb45c" } collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "195fabd025c3021ce0a42a3f76b8f2bad44cb45c" } collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "195fabd025c3021ce0a42a3f76b8f2bad44cb45c" } collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "195fabd025c3021ce0a42a3f76b8f2bad44cb45c" } collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "195fabd025c3021ce0a42a3f76b8f2bad44cb45c" } collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "195fabd025c3021ce0a42a3f76b8f2bad44cb45c" } collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }

View File

@ -7,7 +7,7 @@ use std::sync::Arc;
pub trait CollabCloudPluginProvider: 'static { pub trait CollabCloudPluginProvider: 'static {
fn provider_type(&self) -> CollabPluginProviderType; fn provider_type(&self) -> CollabPluginProviderType;
fn get_plugins(&self, context: CollabPluginProviderContext) -> Fut<Vec<Arc<dyn CollabPlugin>>>; fn get_plugins(&self, context: CollabPluginProviderContext) -> Fut<Vec<Box<dyn CollabPlugin>>>;
fn is_sync_enabled(&self) -> bool; fn is_sync_enabled(&self) -> bool;
} }
@ -20,7 +20,7 @@ where
(**self).provider_type() (**self).provider_type()
} }
fn get_plugins(&self, context: CollabPluginProviderContext) -> Fut<Vec<Arc<dyn CollabPlugin>>> { fn get_plugins(&self, context: CollabPluginProviderContext) -> Fut<Vec<Box<dyn CollabPlugin>>> {
(**self).get_plugins(context) (**self).get_plugins(context)
} }

View File

@ -129,26 +129,31 @@ impl DocumentManager {
} }
} }
/// Return the document /// Returns Document for given object id
/// If the document does not exist in local disk, try get the doc state from the cloud.
/// If the document exists, open the document and cache it
#[tracing::instrument(level = "debug", skip(self), err)] #[tracing::instrument(level = "debug", skip(self), err)]
pub async fn get_document(&self, doc_id: &str) -> FlowyResult<Arc<MutexDocument>> { pub async fn get_document(&self, doc_id: &str) -> FlowyResult<Arc<MutexDocument>> {
if let Some(doc) = self.documents.lock().get(doc_id).cloned() { if let Some(doc) = self.documents.lock().get(doc_id).cloned() {
return Ok(doc); return Ok(doc);
} }
let mut doc_state = vec![]; let mut doc_state = CollabDocState::default();
// If the document does not exist in local disk, try get the doc state from the cloud. This happens
// When user_device_a create a document and user_device_b open the document.
if !self.is_doc_exist(doc_id).await? { if !self.is_doc_exist(doc_id).await? {
// Try to get the document from the cloud service
doc_state = self doc_state = self
.cloud_service .cloud_service
.get_document_doc_state(doc_id, &self.user_service.workspace_id()?) .get_document_doc_state(doc_id, &self.user_service.workspace_id()?)
.await?; .await?;
event!(
tracing::Level::DEBUG, // the doc_state should not be empty if remote return the doc state without error.
"get document from cloud service: {}, size:{}", if doc_state.is_empty() {
doc_id, return Err(FlowyError::new(
doc_state.len() ErrorCode::RecordNotFound,
); format!("document {} not found", doc_id),
));
}
} }
let uid = self.user_service.user_id()?; let uid = self.user_service.user_id()?;
@ -156,15 +161,25 @@ impl DocumentManager {
let collab = self let collab = self
.collab_for_document(uid, doc_id, doc_state, true) .collab_for_document(uid, doc_id, doc_state, true)
.await?; .await?;
let document = Arc::new(MutexDocument::open(doc_id, collab)?);
// save the document to the memory and read it from the memory if we open the same document again. match MutexDocument::open(doc_id, collab) {
// and we don't want to subscribe to the document changes if we open the same document again. Ok(document) => {
self let document = Arc::new(document);
.documents self
.lock() .documents
.put(doc_id.to_string(), document.clone()); .lock()
Ok(document) .put(doc_id.to_string(), document.clone());
Ok(document)
},
Err(err) => {
if err.is_invalid_data() {
if let Some(db) = self.user_service.collab_db(uid)?.upgrade() {
db.delete_doc(uid, doc_id).await?;
}
}
return Err(err);
},
}
} }
pub async fn get_document_data(&self, doc_id: &str) -> FlowyResult<DocumentData> { pub async fn get_document_data(&self, doc_id: &str) -> FlowyResult<DocumentData> {
@ -224,18 +239,6 @@ impl DocumentManager {
}) })
.collect::<Vec<_>>(); .collect::<Vec<_>>();
// let snapshots = self
// .cloud_service
// .get_document_snapshots(document_id, limit, &workspace_id)
// .await?
// .into_iter()
// .map(|snapshot| DocumentSnapshotPB {
// snapshot_id: snapshot.snapshot_id,
// snapshot_desc: "".to_string(),
// created_at: snapshot.created_at,
// })
// .collect::<Vec<_>>();
Ok(metas) Ok(metas)
} }

View File

@ -30,6 +30,7 @@ url = { version = "2.2", optional = true }
collab-database = { version = "0.1.0", optional = true } collab-database = { version = "0.1.0", optional = true }
collab-document = { version = "0.1.0", optional = true } collab-document = { version = "0.1.0", optional = true }
collab-plugins = { version = "0.1.0", optional = true } collab-plugins = { version = "0.1.0", optional = true }
collab-folder = { version = "0.1.0", optional = true }
client-api = { version = "0.1.0", optional = true } client-api = { version = "0.1.0", optional = true }
[features] [features]
@ -38,6 +39,7 @@ impl_from_serde = []
impl_from_reqwest = ["reqwest"] impl_from_reqwest = ["reqwest"]
impl_from_collab_persistence = ["collab-plugins"] impl_from_collab_persistence = ["collab-plugins"]
impl_from_collab_document = ["collab-document", "impl_from_reqwest", "collab-plugins"] impl_from_collab_document = ["collab-document", "impl_from_reqwest", "collab-plugins"]
impl_from_collab_folder = ["collab-folder"]
impl_from_collab_database= ["collab-database"] impl_from_collab_database= ["collab-database"]
impl_from_url = ["url"] impl_from_url = ["url"]

View File

@ -64,6 +64,10 @@ impl FlowyError {
self.code == ErrorCode::UserUnauthorized || self.code == ErrorCode::RecordNotFound self.code == ErrorCode::UserUnauthorized || self.code == ErrorCode::RecordNotFound
} }
pub fn is_invalid_data(&self) -> bool {
self.code == ErrorCode::InvalidParams
}
pub fn is_local_version_not_support(&self) -> bool { pub fn is_local_version_not_support(&self) -> bool {
self.code == ErrorCode::LocalVersionNotSupport self.code == ErrorCode::LocalVersionNotSupport
} }

View File

@ -15,6 +15,22 @@ impl From<DatabaseError> for FlowyError {
#[cfg(feature = "impl_from_collab_document")] #[cfg(feature = "impl_from_collab_document")]
impl From<DocumentError> for FlowyError { impl From<DocumentError> for FlowyError {
fn from(error: DocumentError) -> Self { fn from(error: DocumentError) -> Self {
FlowyError::internal().with_context(error) match error {
DocumentError::NoRequiredData => FlowyError::invalid_data().with_context(error),
_ => FlowyError::internal().with_context(error),
}
}
}
#[cfg(feature = "impl_from_collab_folder")]
use collab_folder::error::FolderError;
#[cfg(feature = "impl_from_collab_folder")]
impl From<FolderError> for FlowyError {
fn from(error: FolderError) -> Self {
match error {
FolderError::NoRequiredData(_) => FlowyError::invalid_data().with_context(error),
_ => FlowyError::internal().with_context(error),
}
} }
} }

View File

@ -18,7 +18,7 @@ flowy-notification = { workspace = true }
parking_lot.workspace = true parking_lot.workspace = true
unicode-segmentation = "1.10" unicode-segmentation = "1.10"
tracing.workspace = true tracing.workspace = true
flowy-error = { path = "../flowy-error", features = ["impl_from_dispatch_error"]} flowy-error = { path = "../flowy-error", features = ["impl_from_dispatch_error", "impl_from_collab_folder"]}
lib-dispatch = { workspace = true } lib-dispatch = { workspace = true }
bytes.workspace = true bytes.workspace = true
lib-infra = { workspace = true } lib-infra = { workspace = true }

View File

@ -4,8 +4,10 @@ use std::sync::{Arc, Weak};
use collab::core::collab::{CollabDocState, MutexCollab}; use collab::core::collab::{CollabDocState, MutexCollab};
use collab_entity::CollabType; use collab_entity::CollabType;
use collab_folder::error::FolderError;
use collab_folder::{ use collab_folder::{
Folder, FolderData, Section, SectionItem, TrashInfo, View, ViewLayout, ViewUpdate, Workspace, Folder, FolderData, FolderNotify, Section, SectionItem, TrashInfo, UserId, View, ViewLayout,
ViewUpdate, Workspace,
}; };
use parking_lot::{Mutex, RwLock}; use parking_lot::{Mutex, RwLock};
use tracing::{error, info, instrument}; use tracing::{error, info, instrument};
@ -15,6 +17,7 @@ use collab_integrate::{CollabKVDB, CollabPersistenceConfig};
use flowy_error::{ErrorCode, FlowyError, FlowyResult}; use flowy_error::{ErrorCode, FlowyError, FlowyResult};
use flowy_folder_pub::cloud::{gen_view_id, FolderCloudService}; use flowy_folder_pub::cloud::{gen_view_id, FolderCloudService};
use flowy_folder_pub::folder_builder::ParentChildViews; use flowy_folder_pub::folder_builder::ParentChildViews;
use lib_infra::conditional_send_sync_trait; use lib_infra::conditional_send_sync_trait;
use crate::entities::icon::UpdateViewIconParams; use crate::entities::icon::UpdateViewIconParams;
@ -46,7 +49,7 @@ conditional_send_sync_trait! {
pub struct FolderManager { pub struct FolderManager {
pub(crate) workspace_id: RwLock<Option<String>>, pub(crate) workspace_id: RwLock<Option<String>>,
pub(crate) mutex_folder: Arc<MutexFolder>, pub(crate) mutex_folder: Arc<MutexFolder>,
collab_builder: Arc<AppFlowyCollabBuilder>, pub(crate) collab_builder: Arc<AppFlowyCollabBuilder>,
pub(crate) user: Arc<dyn FolderUser>, pub(crate) user: Arc<dyn FolderUser>,
pub(crate) operation_handlers: FolderOperationHandlers, pub(crate) operation_handlers: FolderOperationHandlers,
pub cloud_service: Arc<dyn FolderCloudService>, pub cloud_service: Arc<dyn FolderCloudService>,
@ -147,13 +150,15 @@ impl FolderManager {
Ok(views) Ok(views)
} }
pub(crate) async fn collab_for_folder( pub(crate) async fn make_folder<T: Into<Option<FolderNotify>>>(
&self, &self,
uid: i64, uid: i64,
workspace_id: &str, workspace_id: &str,
collab_db: Weak<CollabKVDB>, collab_db: Weak<CollabKVDB>,
collab_doc_state: CollabDocState, collab_doc_state: CollabDocState,
) -> Result<Arc<MutexCollab>, FlowyError> { folder_notifier: T,
) -> Result<Folder, FlowyError> {
let folder_notifier = folder_notifier.into();
let collab = self let collab = self
.collab_builder .collab_builder
.build_with_config( .build_with_config(
@ -168,6 +173,45 @@ impl FolderManager {
CollabBuilderConfig::default().sync_enable(true), CollabBuilderConfig::default().sync_enable(true),
) )
.await?; .await?;
let (should_clear, err) = match Folder::open(UserId::from(uid), collab, folder_notifier) {
Ok(folder) => {
return Ok(folder);
},
Err(err) => (matches!(err, FolderError::NoRequiredData(_)), err),
};
// If opening the folder fails due to missing required data (indicated by a `FolderError::NoRequiredData`),
// the function logs an informational message and attempts to clear the folder data by deleting its
// document from the collaborative database. It then returns the encountered error.
if should_clear {
info!("Clear the folder data and try to open the folder again");
if let Some(db) = self.user.collab_db(uid).ok().and_then(|a| a.upgrade()) {
let _ = db.delete_doc(uid, workspace_id).await;
}
}
Err(err.into())
}
pub(crate) async fn create_empty_collab(
&self,
uid: i64,
workspace_id: &str,
collab_db: Weak<CollabKVDB>,
) -> Result<Arc<MutexCollab>, FlowyError> {
let collab = self
.collab_builder
.build_with_config(
uid,
workspace_id,
CollabType::Folder,
collab_db,
vec![],
CollabPersistenceConfig::new()
.enable_snapshot(true)
.snapshot_per_update(50),
CollabBuilderConfig::default().sync_enable(true),
)
.await?;
Ok(collab) Ok(collab)
} }

View File

@ -1,7 +1,11 @@
use collab_entity::CollabType; use collab_entity::CollabType;
use collab_folder::{Folder, FolderNotify, UserId}; use collab_folder::{Folder, FolderNotify, UserId};
use collab_integrate::CollabKVDB; use collab_integrate::CollabKVDB;
use flowy_error::{FlowyError, FlowyResult}; use flowy_error::{FlowyError, FlowyResult};
use std::sync::{Arc, Weak}; use std::sync::{Arc, Weak};
use tracing::{event, Level}; use tracing::{event, Level};
@ -48,8 +52,9 @@ impl FolderManager {
let is_exist = self.is_workspace_exist_in_local(uid, &workspace_id).await; let is_exist = self.is_workspace_exist_in_local(uid, &workspace_id).await;
// 1. if the folder exists, open it from local disk // 1. if the folder exists, open it from local disk
if is_exist { if is_exist {
event!(Level::INFO, "Init folder from local disk");
self self
.open_local_folder(uid, &workspace_id, collab_db, folder_notifier) .make_folder(uid, &workspace_id, collab_db, vec![], folder_notifier)
.await? .await?
} else if create_if_not_exist { } else if create_if_not_exist {
// 2. if the folder doesn't exist and create_if_not_exist is true, create a default folder // 2. if the folder doesn't exist and create_if_not_exist is true, create a default folder
@ -66,30 +71,40 @@ impl FolderManager {
.get_folder_doc_state(&workspace_id, uid, CollabType::Folder, &workspace_id) .get_folder_doc_state(&workspace_id, uid, CollabType::Folder, &workspace_id)
.await?; .await?;
let collab = self self
.collab_for_folder(uid, &workspace_id, collab_db.clone(), doc_state) .make_folder(
.await?; uid,
Folder::open(UserId::from(uid), collab, Some(folder_notifier.clone()))? &workspace_id,
collab_db.clone(),
doc_state,
folder_notifier.clone(),
)
.await?
} }
}, },
FolderInitDataSource::Cloud(doc_state) => { FolderInitDataSource::Cloud(doc_state) => {
if doc_state.is_empty() { if doc_state.is_empty() {
event!(Level::ERROR, "remote folder data is empty, open from local"); event!(Level::ERROR, "remote folder data is empty, open from local");
self self
.open_local_folder(uid, &workspace_id, collab_db, folder_notifier) .make_folder(uid, &workspace_id, collab_db, vec![], folder_notifier)
.await? .await?
} else { } else {
event!(Level::INFO, "Restore folder with remote data"); event!(Level::INFO, "Restore folder from remote data");
let collab = self self
.collab_for_folder(uid, &workspace_id, collab_db.clone(), doc_state) .make_folder(
.await?; uid,
Folder::open(UserId::from(uid), collab, Some(folder_notifier.clone()))? &workspace_id,
collab_db.clone(),
doc_state,
folder_notifier.clone(),
)
.await?
} }
}, },
FolderInitDataSource::FolderData(folder_data) => { FolderInitDataSource::FolderData(folder_data) => {
event!(Level::INFO, "Restore folder with passed-in folder data"); event!(Level::INFO, "Restore folder with passed-in folder data");
let collab = self let collab = self
.collab_for_folder(uid, &workspace_id, collab_db, vec![]) .create_empty_collab(uid, &workspace_id, collab_db)
.await?; .await?;
Folder::create( Folder::create(
UserId::from(uid), UserId::from(uid),
@ -135,7 +150,7 @@ impl FolderManager {
let folder_data = let folder_data =
DefaultFolderBuilder::build(uid, workspace_id.to_string(), &self.operation_handlers).await; DefaultFolderBuilder::build(uid, workspace_id.to_string(), &self.operation_handlers).await;
let collab = self let collab = self
.collab_for_folder(uid, workspace_id, collab_db, vec![]) .create_empty_collab(uid, workspace_id, collab_db)
.await?; .await?;
Ok(Folder::create( Ok(Folder::create(
UserId::from(uid), UserId::from(uid),
@ -144,19 +159,4 @@ impl FolderManager {
folder_data, folder_data,
)) ))
} }
async fn open_local_folder(
&self,
uid: i64,
workspace_id: &str,
collab_db: Weak<CollabKVDB>,
folder_notifier: FolderNotify,
) -> Result<Folder, FlowyError> {
event!(Level::INFO, "Init folder from local disk");
let collab = self
.collab_for_folder(uid, workspace_id, collab_db, vec![])
.await?;
let folder = Folder::open(UserId::from(uid), collab, Some(folder_notifier))?;
Ok(folder)
}
} }

View File

@ -9,7 +9,7 @@ edition = "2018"
flowy-derive.workspace = true flowy-derive.workspace = true
flowy-sqlite = { workspace = true, optional = true } flowy-sqlite = { workspace = true, optional = true }
flowy-encrypt = { workspace = true } flowy-encrypt = { workspace = true }
flowy-error = { workspace = true, features = ["impl_from_dispatch_error", "impl_from_sqlite"] } flowy-error = { workspace = true, features = ["impl_from_dispatch_error", "impl_from_sqlite", "impl_from_collab_folder", "impl_from_collab_persistence"] }
flowy-folder-pub = { workspace = true } flowy-folder-pub = { workspace = true }
lib-infra = { workspace = true } lib-infra = { workspace = true }
flowy-notification = { workspace = true } flowy-notification = { workspace = true }

View File

@ -9,7 +9,7 @@ use collab_plugins::local_storage::kv::KVTransactionDB;
use tracing::{event, instrument}; use tracing::{event, instrument};
use collab_integrate::{CollabKVAction, CollabKVDB, PersistenceError}; use collab_integrate::{CollabKVAction, CollabKVDB, PersistenceError};
use flowy_error::{internal_error, FlowyError, FlowyResult}; use flowy_error::{FlowyError, FlowyResult};
use flowy_user_pub::entities::Authenticator; use flowy_user_pub::entities::Authenticator;
use crate::migrations::migration::UserDataMigration; use crate::migrations::migration::UserDataMigration;
@ -37,33 +37,32 @@ impl UserDataMigration for HistoricalEmptyDocumentMigration {
if !matches!(authenticator, Authenticator::Local) { if !matches!(authenticator, Authenticator::Local) {
return Ok(()); return Ok(());
} }
collab_db collab_db.with_write_txn(|write_txn| {
.with_write_txn(|write_txn| { let origin = CollabOrigin::Client(CollabClient::new(session.user_id, "phantom"));
let origin = CollabOrigin::Client(CollabClient::new(session.user_id, "phantom")); let folder_collab = match load_collab(session.user_id, write_txn, &session.user_workspace.id)
let folder_collab = {
match load_collab(session.user_id, write_txn, &session.user_workspace.id) { Ok(fc) => fc,
Ok(fc) => fc, Err(_) => return Ok(()),
Err(_) => return Ok(()), };
};
let folder = Folder::open(session.user_id, folder_collab, None)?; let folder = Folder::open(session.user_id, folder_collab, None)
let migration_views = folder.get_workspace_views(); .map_err(|err| PersistenceError::Internal(err.into()))?;
let migration_views = folder.get_workspace_views();
// For historical reasons, the first level documents are empty. So migrate them by inserting // For historical reasons, the first level documents are empty. So migrate them by inserting
// the default document data. // the default document data.
for view in migration_views { for view in migration_views {
if migrate_empty_document(write_txn, &origin, &view, session.user_id).is_err() { if migrate_empty_document(write_txn, &origin, &view, session.user_id).is_err() {
event!( event!(
tracing::Level::ERROR, tracing::Level::ERROR,
"Failed to migrate document {}", "Failed to migrate document {}",
view.id view.id
); );
}
} }
}
Ok(()) Ok(())
}) })?;
.map_err(internal_error)?;
Ok(()) Ok(())
} }

View File

@ -1,11 +1,11 @@
use std::sync::Arc; use std::sync::Arc;
use collab_folder::Folder; use collab_folder::Folder;
use collab_plugins::local_storage::kv::KVTransactionDB; use collab_plugins::local_storage::kv::{KVTransactionDB, PersistenceError};
use tracing::instrument; use tracing::instrument;
use collab_integrate::{CollabKVAction, CollabKVDB}; use collab_integrate::{CollabKVAction, CollabKVDB};
use flowy_error::{internal_error, FlowyResult}; use flowy_error::FlowyResult;
use flowy_user_pub::entities::Authenticator; use flowy_user_pub::entities::Authenticator;
use crate::migrations::migration::UserDataMigration; use crate::migrations::migration::UserDataMigration;
@ -29,33 +29,32 @@ impl UserDataMigration for FavoriteV1AndWorkspaceArrayMigration {
collab_db: &Arc<CollabKVDB>, collab_db: &Arc<CollabKVDB>,
_authenticator: &Authenticator, _authenticator: &Authenticator,
) -> FlowyResult<()> { ) -> FlowyResult<()> {
collab_db collab_db.with_write_txn(|write_txn| {
.with_write_txn(|write_txn| { if let Ok(collab) = load_collab(session.user_id, write_txn, &session.user_workspace.id) {
if let Ok(collab) = load_collab(session.user_id, write_txn, &session.user_workspace.id) { let folder = Folder::open(session.user_id, collab, None)
let folder = Folder::open(session.user_id, collab, None)?; .map_err(|err| PersistenceError::Internal(err.into()))?;
folder.migrate_workspace_to_view(); folder.migrate_workspace_to_view();
let favorite_view_ids = folder let favorite_view_ids = folder
.get_favorite_v1() .get_favorite_v1()
.into_iter() .into_iter()
.map(|fav| fav.id) .map(|fav| fav.id)
.collect::<Vec<String>>(); .collect::<Vec<String>>();
if !favorite_view_ids.is_empty() { if !favorite_view_ids.is_empty() {
folder.add_favorites(favorite_view_ids); folder.add_favorites(favorite_view_ids);
}
let encode = folder.encode_collab_v1();
write_txn.flush_doc_with(
session.user_id,
&session.user_workspace.id,
&encode.doc_state,
&encode.state_vector,
)?;
} }
Ok(())
}) let encode = folder.encode_collab_v1();
.map_err(internal_error)?; write_txn.flush_doc_with(
session.user_id,
&session.user_workspace.id,
&encode.doc_state,
&encode.state_vector,
)?;
}
Ok(())
})?;
Ok(()) Ok(())
} }

View File

@ -1,11 +1,11 @@
use std::sync::Arc; use std::sync::Arc;
use collab_folder::Folder; use collab_folder::Folder;
use collab_plugins::local_storage::kv::KVTransactionDB; use collab_plugins::local_storage::kv::{KVTransactionDB, PersistenceError};
use tracing::instrument; use tracing::instrument;
use collab_integrate::{CollabKVAction, CollabKVDB}; use collab_integrate::{CollabKVAction, CollabKVDB};
use flowy_error::{internal_error, FlowyResult}; use flowy_error::FlowyResult;
use flowy_user_pub::entities::Authenticator; use flowy_user_pub::entities::Authenticator;
use crate::migrations::migration::UserDataMigration; use crate::migrations::migration::UserDataMigration;
@ -27,31 +27,30 @@ impl UserDataMigration for WorkspaceTrashMapToSectionMigration {
collab_db: &Arc<CollabKVDB>, collab_db: &Arc<CollabKVDB>,
_authenticator: &Authenticator, _authenticator: &Authenticator,
) -> FlowyResult<()> { ) -> FlowyResult<()> {
collab_db collab_db.with_write_txn(|write_txn| {
.with_write_txn(|write_txn| { if let Ok(collab) = load_collab(session.user_id, write_txn, &session.user_workspace.id) {
if let Ok(collab) = load_collab(session.user_id, write_txn, &session.user_workspace.id) { let folder = Folder::open(session.user_id, collab, None)
let folder = Folder::open(session.user_id, collab, None)?; .map_err(|err| PersistenceError::Internal(err.into()))?;
let trash_ids = folder let trash_ids = folder
.get_trash_v1() .get_trash_v1()
.into_iter() .into_iter()
.map(|fav| fav.id) .map(|fav| fav.id)
.collect::<Vec<String>>(); .collect::<Vec<String>>();
if !trash_ids.is_empty() { if !trash_ids.is_empty() {
folder.add_trash(trash_ids); folder.add_trash(trash_ids);
}
let encode = folder.encode_collab_v1();
write_txn.flush_doc_with(
session.user_id,
&session.user_workspace.id,
&encode.doc_state,
&encode.state_vector,
)?;
} }
Ok(())
}) let encode = folder.encode_collab_v1();
.map_err(internal_error)?; write_txn.flush_doc_with(
session.user_id,
&session.user_workspace.id,
&encode.doc_state,
&encode.state_vector,
)?;
}
Ok(())
})?;
Ok(()) Ok(())
} }