diff --git a/.github/workflows/rust_ci.yaml b/.github/workflows/rust_ci.yaml index ec766113b442..2702cbd365ee 100644 --- a/.github/workflows/rust_ci.yaml +++ b/.github/workflows/rust_ci.yaml @@ -25,7 +25,7 @@ env: jobs: self-hosted-job: - if: github.event.pull_request.head.repo.full_name != github.repository + if: github.event.pull_request.head.repo.full_name == github.repository runs-on: self-hosted steps: - name: Checkout source code diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.lock b/frontend/appflowy_tauri/src-tauri/Cargo.lock index 6f0df909238b..72e309412769 100644 --- a/frontend/appflowy_tauri/src-tauri/Cargo.lock +++ b/frontend/appflowy_tauri/src-tauri/Cargo.lock @@ -172,7 +172,7 @@ checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "app-error" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=648c977c0752609a00ccdfdc5cc8141789e63c4a#648c977c0752609a00ccdfdc5cc8141789e63c4a" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4643e568d2d9b725b0d06dfbbf351317cf9a2c9f#4643e568d2d9b725b0d06dfbbf351317cf9a2c9f" dependencies = [ "anyhow", "bincode", @@ -192,7 +192,7 @@ dependencies = [ [[package]] name = "appflowy-ai-client" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=648c977c0752609a00ccdfdc5cc8141789e63c4a#648c977c0752609a00ccdfdc5cc8141789e63c4a" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4643e568d2d9b725b0d06dfbbf351317cf9a2c9f#4643e568d2d9b725b0d06dfbbf351317cf9a2c9f" dependencies = [ "anyhow", "bytes", @@ -888,7 +888,7 @@ dependencies = [ [[package]] name = "client-api" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=648c977c0752609a00ccdfdc5cc8141789e63c4a#648c977c0752609a00ccdfdc5cc8141789e63c4a" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4643e568d2d9b725b0d06dfbbf351317cf9a2c9f#4643e568d2d9b725b0d06dfbbf351317cf9a2c9f" dependencies = [ "again", "anyhow", @@ -943,7 +943,7 @@ dependencies = [ [[package]] name = "client-api-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=648c977c0752609a00ccdfdc5cc8141789e63c4a#648c977c0752609a00ccdfdc5cc8141789e63c4a" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4643e568d2d9b725b0d06dfbbf351317cf9a2c9f#4643e568d2d9b725b0d06dfbbf351317cf9a2c9f" dependencies = [ "collab-entity", "collab-rt-entity", @@ -956,7 +956,7 @@ dependencies = [ [[package]] name = "client-websocket" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=648c977c0752609a00ccdfdc5cc8141789e63c4a#648c977c0752609a00ccdfdc5cc8141789e63c4a" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4643e568d2d9b725b0d06dfbbf351317cf9a2c9f#4643e568d2d9b725b0d06dfbbf351317cf9a2c9f" dependencies = [ "futures-channel", "futures-util", @@ -1256,7 +1256,7 @@ dependencies = [ [[package]] name = "collab-rt-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=648c977c0752609a00ccdfdc5cc8141789e63c4a#648c977c0752609a00ccdfdc5cc8141789e63c4a" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4643e568d2d9b725b0d06dfbbf351317cf9a2c9f#4643e568d2d9b725b0d06dfbbf351317cf9a2c9f" dependencies = [ "anyhow", "bincode", @@ -1281,7 +1281,7 @@ dependencies = [ [[package]] name = "collab-rt-protocol" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=648c977c0752609a00ccdfdc5cc8141789e63c4a#648c977c0752609a00ccdfdc5cc8141789e63c4a" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4643e568d2d9b725b0d06dfbbf351317cf9a2c9f#4643e568d2d9b725b0d06dfbbf351317cf9a2c9f" dependencies = [ "anyhow", "async-trait", @@ -1678,7 +1678,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "database-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=648c977c0752609a00ccdfdc5cc8141789e63c4a#648c977c0752609a00ccdfdc5cc8141789e63c4a" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4643e568d2d9b725b0d06dfbbf351317cf9a2c9f#4643e568d2d9b725b0d06dfbbf351317cf9a2c9f" dependencies = [ "anyhow", "app-error", @@ -2476,6 +2476,7 @@ dependencies = [ "async-trait", "bytes", "chrono", + "client-api", "collab", "collab-document", "collab-entity", @@ -2512,6 +2513,7 @@ name = "flowy-folder-pub" version = "0.1.0" dependencies = [ "anyhow", + "client-api", "collab", "collab-entity", "collab-folder", @@ -3263,7 +3265,7 @@ dependencies = [ [[package]] name = "gotrue" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=648c977c0752609a00ccdfdc5cc8141789e63c4a#648c977c0752609a00ccdfdc5cc8141789e63c4a" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4643e568d2d9b725b0d06dfbbf351317cf9a2c9f#4643e568d2d9b725b0d06dfbbf351317cf9a2c9f" dependencies = [ "anyhow", "futures-util", @@ -3280,7 +3282,7 @@ dependencies = [ [[package]] name = "gotrue-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=648c977c0752609a00ccdfdc5cc8141789e63c4a#648c977c0752609a00ccdfdc5cc8141789e63c4a" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4643e568d2d9b725b0d06dfbbf351317cf9a2c9f#4643e568d2d9b725b0d06dfbbf351317cf9a2c9f" dependencies = [ "anyhow", "app-error", @@ -3712,7 +3714,7 @@ dependencies = [ [[package]] name = "infra" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=648c977c0752609a00ccdfdc5cc8141789e63c4a#648c977c0752609a00ccdfdc5cc8141789e63c4a" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4643e568d2d9b725b0d06dfbbf351317cf9a2c9f#4643e568d2d9b725b0d06dfbbf351317cf9a2c9f" dependencies = [ "anyhow", "bytes", @@ -6396,7 +6398,7 @@ dependencies = [ [[package]] name = "shared-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=648c977c0752609a00ccdfdc5cc8141789e63c4a#648c977c0752609a00ccdfdc5cc8141789e63c4a" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=4643e568d2d9b725b0d06dfbbf351317cf9a2c9f#4643e568d2d9b725b0d06dfbbf351317cf9a2c9f" dependencies = [ "anyhow", "app-error", diff --git a/frontend/rust-lib/event-integration-test/src/chat_event.rs b/frontend/rust-lib/event-integration-test/src/chat_event.rs index f7ecf2d886ff..542392742213 100644 --- a/frontend/rust-lib/event-integration-test/src/chat_event.rs +++ b/frontend/rust-lib/event-integration-test/src/chat_event.rs @@ -13,7 +13,6 @@ impl EventIntegrationTest { let payload = CreateViewPayloadPB { parent_view_id: parent_id.to_string(), name: "chat".to_string(), - desc: "".to_string(), thumbnail: None, layout: ViewLayoutPB::Chat, initial_data: vec![], diff --git a/frontend/rust-lib/event-integration-test/src/database_event.rs b/frontend/rust-lib/event-integration-test/src/database_event.rs index 096c692b4f25..80ff21129ac1 100644 --- a/frontend/rust-lib/event-integration-test/src/database_event.rs +++ b/frontend/rust-lib/event-integration-test/src/database_event.rs @@ -38,7 +38,6 @@ impl EventIntegrationTest { let payload = CreateViewPayloadPB { parent_view_id: parent_id.to_string(), name, - desc: "".to_string(), thumbnail: None, layout: ViewLayoutPB::Grid, initial_data, @@ -71,7 +70,6 @@ impl EventIntegrationTest { let payload = CreateViewPayloadPB { parent_view_id: parent_id.to_string(), name, - desc: "".to_string(), thumbnail: None, layout: ViewLayoutPB::Board, initial_data, @@ -99,7 +97,6 @@ impl EventIntegrationTest { let payload = CreateViewPayloadPB { parent_view_id: parent_id.to_string(), name, - desc: "".to_string(), thumbnail: None, layout: ViewLayoutPB::Calendar, initial_data, diff --git a/frontend/rust-lib/event-integration-test/src/document/document_event.rs b/frontend/rust-lib/event-integration-test/src/document/document_event.rs index 71e779389e86..65b4943f80b3 100644 --- a/frontend/rust-lib/event-integration-test/src/document/document_event.rs +++ b/frontend/rust-lib/event-integration-test/src/document/document_event.rs @@ -70,7 +70,6 @@ impl DocumentEventTest { let payload = CreateViewPayloadPB { parent_view_id: parent_id.to_string(), name: "document".to_string(), - desc: "".to_string(), thumbnail: None, layout: ViewLayoutPB::Document, initial_data: vec![], diff --git a/frontend/rust-lib/event-integration-test/src/document_event.rs b/frontend/rust-lib/event-integration-test/src/document_event.rs index 96c1b41e4225..5928c223b8ce 100644 --- a/frontend/rust-lib/event-integration-test/src/document_event.rs +++ b/frontend/rust-lib/event-integration-test/src/document_event.rs @@ -31,7 +31,6 @@ impl EventIntegrationTest { let payload = CreateViewPayloadPB { parent_view_id: parent_id.to_string(), name, - desc: "".to_string(), thumbnail: None, layout: ViewLayoutPB::Document, initial_data, diff --git a/frontend/rust-lib/event-integration-test/src/folder_event.rs b/frontend/rust-lib/event-integration-test/src/folder_event.rs index d8b2fb28c853..f7972c871273 100644 --- a/frontend/rust-lib/event-integration-test/src/folder_event.rs +++ b/frontend/rust-lib/event-integration-test/src/folder_event.rs @@ -125,7 +125,6 @@ impl EventIntegrationTest { .map(|view| CreateViewParams { parent_view_id: view.parent_view_id, name: view.name, - desc: "".to_string(), layout: view.layout.into(), view_id: view.id, initial_data: ViewData::Empty, @@ -154,7 +153,6 @@ impl EventIntegrationTest { pub async fn create_orphan_view(&self, name: &str, view_id: &str, layout: ViewLayoutPB) { let payload = CreateOrphanViewPayloadPB { name: name.to_string(), - desc: "".to_string(), layout, view_id: view_id.to_string(), initial_data: vec![], @@ -288,7 +286,6 @@ impl EventIntegrationTest { let payload = CreateViewPayloadPB { parent_view_id: parent_id.to_string(), name, - desc: "".to_string(), thumbnail: None, layout, initial_data: vec![], @@ -354,7 +351,6 @@ impl ViewTest { let payload = CreateViewPayloadPB { parent_view_id: workspace.id.clone(), name: "View A".to_string(), - desc: "".to_string(), thumbnail: Some("http://1.png".to_string()), layout: layout.into(), initial_data: data, diff --git a/frontend/rust-lib/event-integration-test/tests/folder/local_test/script.rs b/frontend/rust-lib/event-integration-test/tests/folder/local_test/script.rs index 3b6d560a4e2a..22001d997309 100644 --- a/frontend/rust-lib/event-integration-test/tests/folder/local_test/script.rs +++ b/frontend/rust-lib/event-integration-test/tests/folder/local_test/script.rs @@ -254,13 +254,12 @@ pub async fn create_view( sdk: &EventIntegrationTest, parent_view_id: &str, name: &str, - desc: &str, + _desc: &str, layout: ViewLayout, ) -> ViewPB { let request = CreateViewPayloadPB { parent_view_id: parent_view_id.to_string(), name: name.to_string(), - desc: desc.to_string(), thumbnail: None, layout: layout.into(), initial_data: vec![], diff --git a/frontend/rust-lib/flowy-folder/src/lib.rs b/frontend/rust-lib/flowy-folder/src/lib.rs index 55d447bdc72f..6c3305c681b5 100644 --- a/frontend/rust-lib/flowy-folder/src/lib.rs +++ b/frontend/rust-lib/flowy-folder/src/lib.rs @@ -16,6 +16,4 @@ pub mod manager_test_util; pub mod publish_util; pub mod share; -#[cfg(feature = "test_helper")] -mod test_helper; mod util; diff --git a/frontend/rust-lib/flowy-folder/src/test_helper.rs b/frontend/rust-lib/flowy-folder/src/test_helper.rs deleted file mode 100644 index 24c2e0d5e438..000000000000 --- a/frontend/rust-lib/flowy-folder/src/test_helper.rs +++ /dev/null @@ -1,58 +0,0 @@ -use std::collections::HashMap; - -use flowy_folder_pub::cloud::gen_view_id; - -use crate::entities::{CreateViewParams, ViewLayoutPB, ViewSectionPB}; -use crate::manager::FolderManager; -use crate::view_operation::ViewData; - -#[cfg(feature = "test_helper")] -impl FolderManager { - pub async fn create_test_grid_view( - &self, - app_id: &str, - name: &str, - ext: HashMap, - ) -> String { - self - .create_test_view(app_id, name, ViewLayoutPB::Grid, ext) - .await - } - - pub async fn create_test_board_view( - &self, - app_id: &str, - name: &str, - ext: HashMap, - ) -> String { - self - .create_test_view(app_id, name, ViewLayoutPB::Board, ext) - .await - } - - async fn create_test_view( - &self, - app_id: &str, - name: &str, - layout: ViewLayoutPB, - ext: HashMap, - ) -> String { - let view_id = gen_view_id().to_string(); - let params = CreateViewParams { - parent_view_id: app_id.to_string(), - name: name.to_string(), - desc: "".to_string(), - layout, - view_id: view_id.clone(), - initial_data: ViewData::Empty, - meta: ext, - set_as_current: true, - index: None, - section: Some(ViewSectionPB::Public), - icon: None, - extra: None, - }; - self.create_view_with_params(params, true).await.unwrap(); - view_id - } -} diff --git a/frontend/rust-lib/flowy-user/src/migrations/doc_key_with_workspace.rs b/frontend/rust-lib/flowy-user/src/migrations/doc_key_with_workspace.rs index 09490699b67a..3056f4d945ef 100644 --- a/frontend/rust-lib/flowy-user/src/migrations/doc_key_with_workspace.rs +++ b/frontend/rust-lib/flowy-user/src/migrations/doc_key_with_workspace.rs @@ -19,7 +19,11 @@ impl UserDataMigration for CollabDocKeyWithWorkspaceIdMigration { "collab_doc_key_with_workspace_id" } - fn run_when(&self, first_installed_version: &Option, _current_version: &Version) -> bool { + fn run_when( + &self, + first_installed_version: &Option, + _current_version: &Version, + ) -> bool { match first_installed_version { None => { // The user's initial installed version is None if they were using an AppFlowy version diff --git a/frontend/rust-lib/flowy-user/src/migrations/document_empty_content.rs b/frontend/rust-lib/flowy-user/src/migrations/document_empty_content.rs index cc5ccf68a092..e557c22450b4 100644 --- a/frontend/rust-lib/flowy-user/src/migrations/document_empty_content.rs +++ b/frontend/rust-lib/flowy-user/src/migrations/document_empty_content.rs @@ -25,7 +25,11 @@ impl UserDataMigration for HistoricalEmptyDocumentMigration { "historical_empty_document" } - fn run_when(&self, first_installed_version: &Option, _current_version: &Version) -> bool { + fn run_when( + &self, + first_installed_version: &Option, + _current_version: &Version, + ) -> bool { match first_installed_version { None => true, Some(version) => version < &Version::new(0, 4, 0), diff --git a/frontend/rust-lib/flowy-user/src/migrations/workspace_and_favorite_v1.rs b/frontend/rust-lib/flowy-user/src/migrations/workspace_and_favorite_v1.rs index de55819f5732..958699754995 100644 --- a/frontend/rust-lib/flowy-user/src/migrations/workspace_and_favorite_v1.rs +++ b/frontend/rust-lib/flowy-user/src/migrations/workspace_and_favorite_v1.rs @@ -23,7 +23,11 @@ impl UserDataMigration for FavoriteV1AndWorkspaceArrayMigration { "workspace_favorite_v1_and_workspace_array_migration" } - fn run_when(&self, first_installed_version: &Option, _current_version: &Version) -> bool { + fn run_when( + &self, + first_installed_version: &Option, + _current_version: &Version, + ) -> bool { match first_installed_version { None => true, Some(version) => version < &Version::new(0, 4, 0), diff --git a/frontend/rust-lib/flowy-user/src/migrations/workspace_trash_v1.rs b/frontend/rust-lib/flowy-user/src/migrations/workspace_trash_v1.rs index 623a0cbf647d..d631e32e78f6 100644 --- a/frontend/rust-lib/flowy-user/src/migrations/workspace_trash_v1.rs +++ b/frontend/rust-lib/flowy-user/src/migrations/workspace_trash_v1.rs @@ -21,7 +21,11 @@ impl UserDataMigration for WorkspaceTrashMapToSectionMigration { "workspace_trash_map_to_section_migration" } - fn run_when(&self, first_installed_version: &Option, _current_version: &Version) -> bool { + fn run_when( + &self, + first_installed_version: &Option, + _current_version: &Version, + ) -> bool { match first_installed_version { None => true, Some(version) => version < &Version::new(0, 4, 0), diff --git a/frontend/rust-lib/flowy-user/src/services/authenticate_user.rs b/frontend/rust-lib/flowy-user/src/services/authenticate_user.rs index 14fc65ff9a1f..7d770e812390 100644 --- a/frontend/rust-lib/flowy-user/src/services/authenticate_user.rs +++ b/frontend/rust-lib/flowy-user/src/services/authenticate_user.rs @@ -4,7 +4,6 @@ use crate::services::entities::{UserConfig, UserPaths}; use crate::services::sqlite_sql::user_sql::vacuum_database; use collab_integrate::CollabKVDB; - use arc_swap::ArcSwapOption; use collab_plugins::local_storage::kv::doc::CollabKVAction; use collab_plugins::local_storage::kv::KVTransactionDB;