Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
chore: bump collab (#4348)
Nathan.fooo190fae196fba
diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.lock b/frontend/appflowy_tauri/src-tauri/Cargo.lockindex 12edc48b69..68c2af6cce 100644--- a/frontend/appflowy_tauri/src-tauri/Cargo.lock+++ b/frontend/appflowy_tauri/src-tauri/Cargo.lock@@ -139,7 +139,7 @@ checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"[[package]]name = "app-error"version = "0.1.0"-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2159c68688a69af83e1c8d07cf17c40f0c315566#2159c68688a69af83e1c8d07cf17c40f0c315566"+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=284e2bf63800561c75a4eb36ce95692f3fbcca56#284e2bf63800561c75a4eb36ce95692f3fbcca56"dependencies = ["anyhow","reqwest",@@ -147,6 +147,7 @@ dependencies = ["serde_json","serde_repr","thiserror",+ "tokio","url","uuid",]@@ -407,9 +408,9 @@ dependencies = [[[package]]name = "brotli"-version = "3.3.4"+version = "3.4.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68"+checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f"dependencies = ["alloc-no-stdlib","alloc-stdlib",@@ -418,9 +419,9 @@ dependencies = [[[package]]name = "brotli-decompressor"-version = "2.3.4"+version = "2.5.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744"+checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f"dependencies = ["alloc-no-stdlib","alloc-stdlib",@@ -683,12 +684,13 @@ dependencies = [[[package]]name = "client-api"version = "0.1.0"-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2159c68688a69af83e1c8d07cf17c40f0c315566#2159c68688a69af83e1c8d07cf17c40f0c315566"+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=284e2bf63800561c75a4eb36ce95692f3fbcca56#284e2bf63800561c75a4eb36ce95692f3fbcca56"dependencies = ["anyhow","app-error","async-trait","bincode",+ "brotli","bytes","collab","collab-entity",@@ -1147,7 +1149,7 @@ dependencies = ["cssparser-macros","dtoa-short","itoa 1.0.6",- "phf 0.11.2",+ "phf 0.8.0","smallvec",]@@ -1258,7 +1260,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"[[package]]name = "database-entity"version = "0.1.0"-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2159c68688a69af83e1c8d07cf17c40f0c315566#2159c68688a69af83e1c8d07cf17c40f0c315566"+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=284e2bf63800561c75a4eb36ce95692f3fbcca56#284e2bf63800561c75a4eb36ce95692f3fbcca56"dependencies = ["anyhow","app-error",@@ -2505,7 +2507,7 @@ dependencies = [[[package]]name = "gotrue"version = "0.1.0"-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2159c68688a69af83e1c8d07cf17c40f0c315566#2159c68688a69af83e1c8d07cf17c40f0c315566"+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=284e2bf63800561c75a4eb36ce95692f3fbcca56#284e2bf63800561c75a4eb36ce95692f3fbcca56"dependencies = ["anyhow","futures-util",@@ -2521,7 +2523,7 @@ dependencies = [[[package]]name = "gotrue-entity"version = "0.1.0"-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2159c68688a69af83e1c8d07cf17c40f0c315566#2159c68688a69af83e1c8d07cf17c40f0c315566"+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=284e2bf63800561c75a4eb36ce95692f3fbcca56#284e2bf63800561c75a4eb36ce95692f3fbcca56"dependencies = ["anyhow","app-error",@@ -2930,7 +2932,7 @@ dependencies = [[[package]]name = "infra"version = "0.1.0"-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2159c68688a69af83e1c8d07cf17c40f0c315566#2159c68688a69af83e1c8d07cf17c40f0c315566"+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=284e2bf63800561c75a4eb36ce95692f3fbcca56#284e2bf63800561c75a4eb36ce95692f3fbcca56"dependencies = ["anyhow","reqwest",@@ -3935,7 +3937,6 @@ version = "0.11.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc"dependencies = [- "phf_macros 0.11.2","phf_shared 0.11.2",]@@ -4027,19 +4028,6 @@ dependencies = ["syn 1.0.109",]-[[package]]-name = "phf_macros"-version = "0.11.2"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b"-dependencies = [- "phf_generator 0.11.2",- "phf_shared 0.11.2",- "proc-macro2",- "quote",- "syn 2.0.47",-]-[[package]]name = "phf_shared"version = "0.8.0"@@ -4587,7 +4575,7 @@ dependencies = [[[package]]name = "realtime-entity"version = "0.1.0"-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2159c68688a69af83e1c8d07cf17c40f0c315566#2159c68688a69af83e1c8d07cf17c40f0c315566"+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=284e2bf63800561c75a4eb36ce95692f3fbcca56#284e2bf63800561c75a4eb36ce95692f3fbcca56"dependencies = ["anyhow","bincode",@@ -4609,7 +4597,7 @@ dependencies = [[[package]]name = "realtime-protocol"version = "0.1.0"-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2159c68688a69af83e1c8d07cf17c40f0c315566#2159c68688a69af83e1c8d07cf17c40f0c315566"+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=284e2bf63800561c75a4eb36ce95692f3fbcca56#284e2bf63800561c75a4eb36ce95692f3fbcca56"dependencies = ["anyhow","bincode",@@ -5256,7 +5244,7 @@ dependencies = [[[package]]name = "shared_entity"version = "0.1.0"-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2159c68688a69af83e1c8d07cf17c40f0c315566#2159c68688a69af83e1c8d07cf17c40f0c315566"+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=284e2bf63800561c75a4eb36ce95692f3fbcca56#284e2bf63800561c75a4eb36ce95692f3fbcca56"dependencies = ["anyhow","app-error",@@ -7039,7 +7027,7 @@ dependencies = [[[package]]name = "workspace-template"version = "0.1.0"-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2159c68688a69af83e1c8d07cf17c40f0c315566#2159c68688a69af83e1c8d07cf17c40f0c315566"+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=284e2bf63800561c75a4eb36ce95692f3fbcca56#284e2bf63800561c75a4eb36ce95692f3fbcca56"dependencies = ["anyhow","async-trait",diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.toml b/frontend/appflowy_tauri/src-tauri/Cargo.tomlindex 4759cf70b5..541313483c 100644--- a/frontend/appflowy_tauri/src-tauri/Cargo.toml+++ b/frontend/appflowy_tauri/src-tauri/Cargo.toml@@ -57,7 +57,7 @@ custom-protocol = ["tauri/custom-protocol"]# Run the script:# scripts/tool/update_client_api_rev.sh new_rev_id# ⚠️⚠️⚠️️-client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "2159c68688a69af83e1c8d07cf17c40f0c315566" }+client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "284e2bf63800561c75a4eb36ce95692f3fbcca56" }# Please use the following script to update collab.# Working directory: frontend#diff --git a/frontend/rust-lib/Cargo.lock b/frontend/rust-lib/Cargo.lockindex 62442c0def..9c2d226003 100644--- a/frontend/rust-lib/Cargo.lock+++ b/frontend/rust-lib/Cargo.lock@@ -95,6 +95,21 @@ dependencies = ["pin-project",]+[[package]]+name = "alloc-no-stdlib"+version = "2.0.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3"++[[package]]+name = "alloc-stdlib"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece"+dependencies = [+ "alloc-no-stdlib",+]+[[package]]name = "allocator-api2"version = "0.2.16"@@ -125,7 +140,7 @@ checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"[[package]]name = "app-error"version = "0.1.0"-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2159c68688a69af83e1c8d07cf17c40f0c315566#2159c68688a69af83e1c8d07cf17c40f0c315566"+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=284e2bf63800561c75a4eb36ce95692f3fbcca56#284e2bf63800561c75a4eb36ce95692f3fbcca56"dependencies = ["anyhow","reqwest",@@ -133,6 +148,7 @@ dependencies = ["serde_json","serde_repr","thiserror",+ "tokio","url","uuid",]@@ -460,6 +476,27 @@ dependencies = ["syn 1.0.109",]+[[package]]+name = "brotli"+version = "3.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f"+dependencies = [+ "alloc-no-stdlib",+ "alloc-stdlib",+ "brotli-decompressor",+]++[[package]]+name = "brotli-decompressor"+version = "2.5.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f"+dependencies = [+ "alloc-no-stdlib",+ "alloc-stdlib",+]+[[package]]name = "bstr"version = "1.6.2"@@ -620,12 +657,13 @@ dependencies = [[[package]]name = "client-api"version = "0.1.0"-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2159c68688a69af83e1c8d07cf17c40f0c315566#2159c68688a69af83e1c8d07cf17c40f0c315566"+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=284e2bf63800561c75a4eb36ce95692f3fbcca56#284e2bf63800561c75a4eb36ce95692f3fbcca56"dependencies = ["anyhow","app-error","async-trait","bincode",+ "brotli","bytes","collab","collab-entity",@@ -1155,7 +1193,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"[[package]]name = "database-entity"version = "0.1.0"-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2159c68688a69af83e1c8d07cf17c40f0c315566#2159c68688a69af83e1c8d07cf17c40f0c315566"+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=284e2bf63800561c75a4eb36ce95692f3fbcca56#284e2bf63800561c75a4eb36ce95692f3fbcca56"dependencies = ["anyhow","app-error",@@ -2306,7 +2344,7 @@ dependencies = [[[package]]name = "gotrue"version = "0.1.0"-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2159c68688a69af83e1c8d07cf17c40f0c315566#2159c68688a69af83e1c8d07cf17c40f0c315566"+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=284e2bf63800561c75a4eb36ce95692f3fbcca56#284e2bf63800561c75a4eb36ce95692f3fbcca56"dependencies = ["anyhow","futures-util",@@ -2322,7 +2360,7 @@ dependencies = [[[package]]name = "gotrue-entity"version = "0.1.0"-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2159c68688a69af83e1c8d07cf17c40f0c315566#2159c68688a69af83e1c8d07cf17c40f0c315566"+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=284e2bf63800561c75a4eb36ce95692f3fbcca56#284e2bf63800561c75a4eb36ce95692f3fbcca56"dependencies = ["anyhow","app-error",@@ -2670,7 +2708,7 @@ dependencies = [[[package]]name = "infra"version = "0.1.0"-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2159c68688a69af83e1c8d07cf17c40f0c315566#2159c68688a69af83e1c8d07cf17c40f0c315566"+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=284e2bf63800561c75a4eb36ce95692f3fbcca56#284e2bf63800561c75a4eb36ce95692f3fbcca56"dependencies = ["anyhow","reqwest",@@ -2794,6 +2832,7 @@ version = "0.1.0"dependencies = ["anyhow","async-trait",+ "brotli","bytes","chrono","futures-core",@@ -4036,7 +4075,7 @@ dependencies = [[[package]]name = "realtime-entity"version = "0.1.0"-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2159c68688a69af83e1c8d07cf17c40f0c315566#2159c68688a69af83e1c8d07cf17c40f0c315566"+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=284e2bf63800561c75a4eb36ce95692f3fbcca56#284e2bf63800561c75a4eb36ce95692f3fbcca56"dependencies = ["anyhow","bincode",@@ -4058,7 +4097,7 @@ dependencies = [[[package]]name = "realtime-protocol"version = "0.1.0"-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2159c68688a69af83e1c8d07cf17c40f0c315566#2159c68688a69af83e1c8d07cf17c40f0c315566"+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=284e2bf63800561c75a4eb36ce95692f3fbcca56#284e2bf63800561c75a4eb36ce95692f3fbcca56"dependencies = ["anyhow","bincode",@@ -4636,7 +4675,7 @@ dependencies = [[[package]]name = "shared_entity"version = "0.1.0"-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2159c68688a69af83e1c8d07cf17c40f0c315566#2159c68688a69af83e1c8d07cf17c40f0c315566"+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=284e2bf63800561c75a4eb36ce95692f3fbcca56#284e2bf63800561c75a4eb36ce95692f3fbcca56"dependencies = ["anyhow","app-error",@@ -5934,7 +5973,7 @@ dependencies = [[[package]]name = "workspace-template"version = "0.1.0"-source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=2159c68688a69af83e1c8d07cf17c40f0c315566#2159c68688a69af83e1c8d07cf17c40f0c315566"+source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=284e2bf63800561c75a4eb36ce95692f3fbcca56#284e2bf63800561c75a4eb36ce95692f3fbcca56"dependencies = ["anyhow","async-trait",diff --git a/frontend/rust-lib/Cargo.toml b/frontend/rust-lib/Cargo.tomlindex b9a56fa125..700e5a91ee 100644--- a/frontend/rust-lib/Cargo.toml+++ b/frontend/rust-lib/Cargo.toml@@ -107,7 +107,7 @@ incremental = false# Run the script:# scripts/tool/update_client_api_rev.sh new_rev_id# ⚠️⚠️⚠️️-client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "2159c68688a69af83e1c8d07cf17c40f0c315566" }+client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "284e2bf63800561c75a4eb36ce95692f3fbcca56" }# Please use the following script to update collab.# Working directory: frontend#diff --git a/frontend/rust-lib/flowy-ai/tests/text/mod.rs b/frontend/rust-lib/flowy-ai/tests/text/mod.rsindex 6e0de3680e..4b785ba69e 100644--- a/frontend/rust-lib/flowy-ai/tests/text/mod.rs+++ b/frontend/rust-lib/flowy-ai/tests/text/mod.rs@@ -1 +1 @@-mod completion_test;+// mod completion_test;diff --git a/frontend/rust-lib/flowy-document/src/manager.rs b/frontend/rust-lib/flowy-document/src/manager.rsindex f14fc042dc..3a8949364b 100644--- a/frontend/rust-lib/flowy-document/src/manager.rs+++ b/frontend/rust-lib/flowy-document/src/manager.rs@@ -154,6 +154,12 @@ impl DocumentManager {.cloud_service.get_document_doc_state(doc_id, &self.user_service.workspace_id()?).await?;+ event!(+ tracing::Level::DEBUG,+ "get document from cloud service: {}, size:{}",+ doc_id,+ doc_state.len()+ );}let uid = self.user_service.user_id()?;diff --git a/frontend/rust-lib/flowy-server/src/af_cloud/impls/user/cloud_service_impl.rs b/frontend/rust-lib/flowy-server/src/af_cloud/impls/user/cloud_service_impl.rsindex 15250ed597..9168e268ba 100644--- a/frontend/rust-lib/flowy-server/src/af_cloud/impls/user/cloud_service_impl.rs+++ b/frontend/rust-lib/flowy-server/src/af_cloud/impls/user/cloud_service_impl.rs@@ -4,6 +4,7 @@ use std::sync::Arc;use anyhow::{anyhow, Error};use client_api::entity::workspace_dto::{CreateWorkspaceMember, WorkspaceMemberChangeset};use client_api::entity::{AFRole, AFWorkspace, AuthProvider, CollabParams, CreateCollabParams};+use client_api::ClientConfiguration;use collab::core::collab::CollabDocState;use collab_entity::CollabObject;use parking_lot::RwLock;@@ -79,8 +80,12 @@ where"GOTRUE_ADMIN_PASSWORD is not set. Please set it to the admin password for the test server")})?;- let admin_client =- client_api::Client::new(client.base_url(), client.ws_addr(), client.gotrue_url());+ let admin_client = client_api::Client::new(+ client.base_url(),+ client.ws_addr(),+ client.gotrue_url(),+ ClientConfiguration::default(),+ );admin_client.sign_in_password(&admin_email, &admin_password).await?;@@ -238,15 +243,13 @@ wherelet collab_object = collab_object.clone();FutureResult::new(async move {let client = try_get_client?;- let params = CreateCollabParams::new(- collab_object.workspace_id.clone(),- CollabParams {- object_id: collab_object.object_id.clone(),- encoded_collab_v1: data,- collab_type: collab_object.collab_type.clone(),- override_if_exist,- },- );+ let params = CreateCollabParams {+ workspace_id: collab_object.workspace_id.clone(),+ object_id: collab_object.object_id.clone(),+ encoded_collab_v1: data,+ collab_type: collab_object.collab_type.clone(),+ override_if_exist,+ };client.create_collab(params).await?;Ok(())})diff --git a/frontend/rust-lib/flowy-server/src/af_cloud/server.rs b/frontend/rust-lib/flowy-server/src/af_cloud/server.rsindex 26cc5d14db..8cacdf6005 100644--- a/frontend/rust-lib/flowy-server/src/af_cloud/server.rs+++ b/frontend/rust-lib/flowy-server/src/af_cloud/server.rs@@ -8,7 +8,7 @@ use client_api::notify::{TokenState, TokenStateReceiver};use client_api::ws::{ConnectState, WSClient, WSClientConfig, WSConnectStateReceiver, WebSocketChannel,};-use client_api::Client;+use client_api::{Client, ClientConfiguration};use tokio::sync::watch;use tokio_stream::wrappers::WatchStream;use tracing::{error, event, info};@@ -45,7 +45,14 @@ pub struct AppFlowyCloudServer {impl AppFlowyCloudServer {pub fn new(config: AFCloudConfiguration, enable_sync: bool, device_id: String) -> Self {- let api_client = AFCloudClient::new(&config.base_url, &config.ws_base_url, &config.gotrue_url);+ let api_client = AFCloudClient::new(+ &config.base_url,+ &config.ws_base_url,+ &config.gotrue_url,+ ClientConfiguration::default()+ .with_compression_buffer_size(10240)+ .with_compression_quality(8),+ );let token_state_rx = api_client.subscribe_token_state();let enable_sync = Arc::new(AtomicBool::new(enable_sync));let network_reachable = Arc::new(AtomicBool::new(true));diff --git a/frontend/rust-lib/flowy-server/tests/af_cloud_test/util.rs b/frontend/rust-lib/flowy-server/tests/af_cloud_test/util.rsindex 1b925c6eeb..a1f8a493d1 100644--- a/frontend/rust-lib/flowy-server/tests/af_cloud_test/util.rs+++ b/frontend/rust-lib/flowy-server/tests/af_cloud_test/util.rs@@ -1,3 +1,4 @@+use client_api::ClientConfiguration;use std::collections::HashMap;use std::sync::Arc;@@ -29,11 +30,20 @@ pub fn af_cloud_server(config: AFCloudConfiguration) -> Arc<AppFlowyCloudServer>}pub async fn generate_sign_in_url(user_email: &str, config: &AFCloudConfiguration) -> String {- let client = client_api::Client::new(&config.base_url, &config.ws_base_url, &config.gotrue_url);+ let client = client_api::Client::new(+ &config.base_url,+ &config.ws_base_url,+ &config.gotrue_url,+ ClientConfiguration::default(),+ );let admin_email = std::env::var("GOTRUE_ADMIN_EMAIL").unwrap();let admin_password = std::env::var("GOTRUE_ADMIN_PASSWORD").unwrap();- let admin_client =- client_api::Client::new(client.base_url(), client.ws_addr(), client.gotrue_url());+ let admin_client = client_api::Client::new(+ client.base_url(),+ client.ws_addr(),+ client.gotrue_url(),+ ClientConfiguration::default(),+ );admin_client.sign_in_password(&admin_email, &admin_password).awaitdiff --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.rsindex fdc8a8265c..2105c41dd4 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@@ -398,13 +398,18 @@ where}let encoded_collab = doc.get_encoded_collab_v1();+ info!(+ "import collab:{} with len: {}",+ new_object_id,+ encoded_collab.doc_state.len()+ );if let Err(err) = w_txn.flush_doc(new_uid,&new_object_id,encoded_collab.state_vector.to_vec(),encoded_collab.doc_state.to_vec(),) {- tracing::error!("import collab:{} failed: {:?}", new_object_id, err);+ error!("import collab:{} failed: {:?}", new_object_id, err);}} else {event!(tracing::Level::ERROR, "decode v1 failed");@@ -630,7 +635,7 @@ pub async fn upload_imported_data(// Uploadlet mut size_counter = 0;let mut objects: Vec<UserCollabParams> = vec![];- let upload_size_limit = 2 * 1024 * 1024;+ let upload_size_limit = 4 * 1024 * 1024;for (collab_type, encoded_collab_by_oid) in object_by_collab_type {info!("Batch import collab:{} ids: {:?}",@@ -686,6 +691,14 @@ async fn batch_create(size_counter: &usize,objects: Vec<UserCollabParams>,) {+ if objects.len() == 1 && size_counter > &(4 * 1024 * 1024) {+ info!(+ "Skip upload collab object: {}, payload size: {}",+ objects[0].object_id, size_counter+ );+ return;+ }+let ids = objects.iter().map(|o| o.object_id.clone())diff --git a/frontend/rust-lib/lib-infra/Cargo.toml b/frontend/rust-lib/lib-infra/Cargo.tomlindex 64e9b60e9b..4586b2be97 100644--- a/frontend/rust-lib/lib-infra/Cargo.toml+++ b/frontend/rust-lib/lib-infra/Cargo.toml@@ -22,3 +22,7 @@ validator = "0.16.0"[target.'cfg(not(target_arch = "wasm32"))'.dependencies]zip = { version = "0.6.6", features = ["deflate"] }+brotli = { version = "3.4.0", optional = true }++[features]+compression = ["brotli"]diff --git a/frontend/rust-lib/lib-infra/src/compression.rs b/frontend/rust-lib/lib-infra/src/compression.rsnew file mode 100644index 0000000000..e86a136543--- /dev/null+++ b/frontend/rust-lib/lib-infra/src/compression.rs@@ -0,0 +1,17 @@+use brotli::{CompressorReader, Decompressor};+use std::io;+use std::io::Read;++pub fn compress(data: &[u8], quality: u32, buffer_size: usize) -> io::Result<Vec<u8>> {+ let mut compressor = CompressorReader::new(data, buffer_size, quality, 22);+ let mut compressed_data = Vec::new();+ compressor.read_to_end(&mut compressed_data)?;+ Ok(compressed_data)+}++pub fn decompress(data: &[u8], buffer_size: usize) -> io::Result<Vec<u8>> {+ let mut decompressor = Decompressor::new(data, buffer_size);+ let mut decompressed_data = Vec::new();+ decompressor.read_to_end(&mut decompressed_data)?;+ Ok(decompressed_data)+}diff --git a/frontend/rust-lib/lib-infra/src/lib.rs b/frontend/rust-lib/lib-infra/src/lib.rsindex 7aa0cdc498..1789e97b2a 100644--- a/frontend/rust-lib/lib-infra/src/lib.rs+++ b/frontend/rust-lib/lib-infra/src/lib.rs@@ -4,6 +4,9 @@ pub mod box_any;#[cfg(not(target_arch = "wasm32"))]pub mod file_util;+#[cfg(feature = "compression")]+pub mod compression;+pub mod future;pub mod ref_map;pub mod util;