diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.lock b/frontend/appflowy_tauri/src-tauri/Cargo.lock index 120f09266b..982d33e01f 100644 --- a/frontend/appflowy_tauri/src-tauri/Cargo.lock +++ b/frontend/appflowy_tauri/src-tauri/Cargo.lock @@ -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=e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd#e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" 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=e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd#e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" 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=e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd#e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" 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=e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd#e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" 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=e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd#e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" 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=e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd#e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" dependencies = [ "anyhow", "async-stream", @@ -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=e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd#e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" dependencies = [ "anyhow", "collab", diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.toml b/frontend/appflowy_tauri/src-tauri/Cargo.toml index e0b98774a3..9b8f85c2c4 100644 --- a/frontend/appflowy_tauri/src-tauri/Cargo.toml +++ b/frontend/appflowy_tauri/src-tauri/Cargo.toml @@ -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 = "e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" } +collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" } +collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" } +collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" } +collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" } +collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" } +collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" } # 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..262b4418b0 100644 --- a/frontend/appflowy_web_app/src-tauri/Cargo.lock +++ b/frontend/appflowy_web_app/src-tauri/Cargo.lock @@ -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=e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd#e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" 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=e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd#e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" 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=e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd#e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" 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=e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd#e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" 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=e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd#e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" 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=e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd#e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" dependencies = [ "anyhow", "async-stream", @@ -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=e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd#e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" dependencies = [ "anyhow", "collab", diff --git a/frontend/appflowy_web_app/src-tauri/Cargo.toml b/frontend/appflowy_web_app/src-tauri/Cargo.toml index 2db7456f50..7a091b39dc 100644 --- a/frontend/appflowy_web_app/src-tauri/Cargo.toml +++ b/frontend/appflowy_web_app/src-tauri/Cargo.toml @@ -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 = "e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" } +collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" } +collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" } +collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" } +collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" } +collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" } +collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" } # 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..84e973b595 100644 --- a/frontend/rust-lib/Cargo.lock +++ b/frontend/rust-lib/Cargo.lock @@ -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=e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd#e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" 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=e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd#e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" 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=e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd#e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" 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=e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd#e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" 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=e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd#e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" 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=e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd#e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" dependencies = [ "anyhow", "async-stream", @@ -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=e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd#e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" dependencies = [ "anyhow", "collab", diff --git a/frontend/rust-lib/Cargo.toml b/frontend/rust-lib/Cargo.toml index 4d9a5ed452..6766328c2c 100644 --- a/frontend/rust-lib/Cargo.toml +++ b/frontend/rust-lib/Cargo.toml @@ -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 = "e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" } +collab-entity = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" } +collab-folder = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" } +collab-document = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" } +collab-database = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" } +collab-plugins = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" } +collab-user = { version = "0.2", git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "e7324ca0dfce7a7a2e6cabcb1db6980ecf38affd" } # Working directory: frontend # To update the commit ID, run: diff --git a/frontend/rust-lib/flowy-database2/src/manager.rs b/frontend/rust-lib/flowy-database2/src/manager.rs index 3885a8d0e6..571f09c5fc 100644 --- a/frontend/rust-lib/flowy-database2/src/manager.rs +++ b/frontend/rust-lib/flowy-database2/src/manager.rs @@ -370,7 +370,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,26 +906,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, encoded_collab) in encoded_collabs { + write_txn + .flush_doc( + uid, + &object_id, + encoded_collab.state_vector.to_vec(), + encoded_collab.doc_state.to_vec(), + ) + .map_err(|err| DatabaseError::Internal(anyhow!("failed to flush doc: {}", err)))?; + } write_txn .commit_transaction() 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..d64ccad5a1 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,6 @@ 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_document::document_data::default_document_collab_data; use collab_entity::CollabType; use collab_folder::{Folder, UserId, View, ViewIdentifier, ViewLayout}; @@ -22,6 +21,7 @@ use collab_integrate::{CollabKVAction, CollabKVDB, PersistenceError}; use collab_plugins::local_storage::kv::KVTransactionDB; use collab::preclude::updates::encoder::Encode; +use collab_database::workspace_database::WorkspaceDatabaseBody; use flowy_error::FlowyError; use flowy_folder_pub::cloud::gen_view_id; use flowy_folder_pub::entities::{AppFlowyData, ImportData}; @@ -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| {