From 1ccff73e490f90af855898024dd3feed29bf2833 Mon Sep 17 00:00:00 2001 From: "Nathan.fooo" <86001920+appflowy@users.noreply.github.com> Date: Thu, 12 Sep 2024 00:28:26 +0800 Subject: [PATCH] chore: bump appflowy collab (#814) * chore: bump appflowy collab * chore: fix build --- Cargo.lock | 12 ++++++------ Cargo.toml | 12 ++++++------ libs/client-api/src/collab_sync/plugin.rs | 5 +++++ .../src/group/plugin/history_plugin.rs | 10 +++++++--- 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f69fb626..114653ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2092,7 +2092,7 @@ dependencies = [ [[package]] name = "collab" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=28c439274c222bbc298dc6753200ee492d7e8509#28c439274c222bbc298dc6753200ee492d7e8509" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=71c5bd32ddb72252e8f8eddfd4f5ce75ecd31354#71c5bd32ddb72252e8f8eddfd4f5ce75ecd31354" dependencies = [ "anyhow", "arc-swap", @@ -2117,7 +2117,7 @@ dependencies = [ [[package]] name = "collab-database" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=28c439274c222bbc298dc6753200ee492d7e8509#28c439274c222bbc298dc6753200ee492d7e8509" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=71c5bd32ddb72252e8f8eddfd4f5ce75ecd31354#71c5bd32ddb72252e8f8eddfd4f5ce75ecd31354" dependencies = [ "anyhow", "async-trait", @@ -2147,7 +2147,7 @@ dependencies = [ [[package]] name = "collab-document" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=28c439274c222bbc298dc6753200ee492d7e8509#28c439274c222bbc298dc6753200ee492d7e8509" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=71c5bd32ddb72252e8f8eddfd4f5ce75ecd31354#71c5bd32ddb72252e8f8eddfd4f5ce75ecd31354" dependencies = [ "anyhow", "arc-swap", @@ -2167,7 +2167,7 @@ dependencies = [ [[package]] name = "collab-entity" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=28c439274c222bbc298dc6753200ee492d7e8509#28c439274c222bbc298dc6753200ee492d7e8509" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=71c5bd32ddb72252e8f8eddfd4f5ce75ecd31354#71c5bd32ddb72252e8f8eddfd4f5ce75ecd31354" dependencies = [ "anyhow", "bytes", @@ -2186,7 +2186,7 @@ dependencies = [ [[package]] name = "collab-folder" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=28c439274c222bbc298dc6753200ee492d7e8509#28c439274c222bbc298dc6753200ee492d7e8509" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=71c5bd32ddb72252e8f8eddfd4f5ce75ecd31354#71c5bd32ddb72252e8f8eddfd4f5ce75ecd31354" dependencies = [ "anyhow", "arc-swap", @@ -2271,7 +2271,7 @@ dependencies = [ [[package]] name = "collab-user" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=28c439274c222bbc298dc6753200ee492d7e8509#28c439274c222bbc298dc6753200ee492d7e8509" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=71c5bd32ddb72252e8f8eddfd4f5ce75ecd31354#71c5bd32ddb72252e8f8eddfd4f5ce75ecd31354" dependencies = [ "anyhow", "collab", diff --git a/Cargo.toml b/Cargo.toml index 9244ac9a..00f3d66d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -288,12 +288,12 @@ debug = true [patch.crates-io] # It's diffcult to resovle different version with the same crate used in AppFlowy Frontend and the Client-API crate. # So using patch to workaround this issue. -collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "28c439274c222bbc298dc6753200ee492d7e8509" } -collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "28c439274c222bbc298dc6753200ee492d7e8509" } -collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "28c439274c222bbc298dc6753200ee492d7e8509" } -collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "28c439274c222bbc298dc6753200ee492d7e8509" } -collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "28c439274c222bbc298dc6753200ee492d7e8509" } -collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "28c439274c222bbc298dc6753200ee492d7e8509" } +collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "71c5bd32ddb72252e8f8eddfd4f5ce75ecd31354" } +collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "71c5bd32ddb72252e8f8eddfd4f5ce75ecd31354" } +collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "71c5bd32ddb72252e8f8eddfd4f5ce75ecd31354" } +collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "71c5bd32ddb72252e8f8eddfd4f5ce75ecd31354" } +collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "71c5bd32ddb72252e8f8eddfd4f5ce75ecd31354" } +collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "71c5bd32ddb72252e8f8eddfd4f5ce75ecd31354" } [features] history = [] diff --git a/libs/client-api/src/collab_sync/plugin.rs b/libs/client-api/src/collab_sync/plugin.rs index e7beea32..d908e784 100644 --- a/libs/client-api/src/collab_sync/plugin.rs +++ b/libs/client-api/src/collab_sync/plugin.rs @@ -6,6 +6,7 @@ use std::time::Duration; use anyhow::anyhow; use collab::core::awareness::{AwarenessUpdate, Event}; +use collab::core::collab_plugin::CollabPluginType; use collab::core::collab_state::SyncState; use collab::core::origin::CollabOrigin; use collab::preclude::{Collab, CollabPlugin}; @@ -141,6 +142,10 @@ where Stream: StreamExt> + Send + Sync + Unpin + 'static, Channel: Send + Sync + 'static, { + fn plugin_type(&self) -> CollabPluginType { + CollabPluginType::CloudStorage + } + fn did_init(&self, _collab: &Collab, _object_id: &str) { // Most of the time, it should be successful to queue init sync by 1st time. let retry_strategy = FixedInterval::new(Duration::from_secs(1)).take(10); diff --git a/services/appflowy-collaborate/src/group/plugin/history_plugin.rs b/services/appflowy-collaborate/src/group/plugin/history_plugin.rs index 0ac505ed..7e989d49 100644 --- a/services/appflowy-collaborate/src/group/plugin/history_plugin.rs +++ b/services/appflowy-collaborate/src/group/plugin/history_plugin.rs @@ -1,9 +1,9 @@ -use std::sync::atomic::{AtomicBool, AtomicU32, Ordering}; -use std::sync::{Arc, Weak}; - +use collab::core::collab_plugin::CollabPluginType; use collab::lock::RwLock; use collab::preclude::{Collab, CollabPlugin}; use collab_entity::CollabType; +use std::sync::atomic::{AtomicBool, AtomicU32, Ordering}; +use std::sync::{Arc, Weak}; use tokio::time::sleep; use tracing::{error, trace}; use yrs::TransactionMut; @@ -117,4 +117,8 @@ where } }); } + + fn plugin_type(&self) -> CollabPluginType { + CollabPluginType::Other("history".to_string()) + } }