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: set min version number (#5390)
Nathan.fooo68c4e19f910d
diff --git a/frontend/appflowy_tauri/src-tauri/Cargo.toml b/frontend/appflowy_tauri/src-tauri/Cargo.tomlindex 9206c93d27..6b3a671077 100644--- a/frontend/appflowy_tauri/src-tauri/Cargo.toml+++ b/frontend/appflowy_tauri/src-tauri/Cargo.toml@@ -94,6 +94,7 @@ flowy-notification = { path = "../../rust-lib/flowy-notification", features = [uuid = "1.5.0"tauri-plugin-deep-link = "0.1.2"dotenv = "0.15.0"+semver = "1.0.23"[features]# by default Tauri runs in production modediff --git a/frontend/appflowy_tauri/src-tauri/src/init.rs b/frontend/appflowy_tauri/src-tauri/src/init.rsindex 1702c02923..7591ba37ff 100644--- a/frontend/appflowy_tauri/src-tauri/src/init.rs+++ b/frontend/appflowy_tauri/src-tauri/src/init.rs@@ -34,7 +34,8 @@ pub fn init_flowy_core() -> AppFlowyCore {.version.clone().map(|v| v.to_string())- .unwrap_or_else(|| "0.0.0".to_string());+ .unwrap_or_else(|| "0.5.8".to_string());+ let app_version = semver::Version::parse(&app_version).unwrap_or_else(|_| semver::Version::new(0, 5, 8));let mut data_path = tauri::api::path::app_local_data_dir(&config).unwrap();if cfg!(debug_assertions) {data_path.push("data_dev");diff --git a/frontend/appflowy_web_app/src-tauri/Cargo.toml b/frontend/appflowy_web_app/src-tauri/Cargo.tomlindex 45d822b46e..54e09acf6c 100644--- a/frontend/appflowy_web_app/src-tauri/Cargo.toml+++ b/frontend/appflowy_web_app/src-tauri/Cargo.toml@@ -93,6 +93,7 @@ flowy-notification = { path = "../../rust-lib/flowy-notification", features = [uuid = "1.5.0"tauri-plugin-deep-link = "0.1.2"dotenv = "0.15.0"+semver = "1.0.23"[features]# by default Tauri runs in production modediff --git a/frontend/appflowy_web_app/src-tauri/src/init.rs b/frontend/appflowy_web_app/src-tauri/src/init.rsindex 923ab0ff8f..42c857abdf 100644--- a/frontend/appflowy_web_app/src-tauri/src/init.rs+++ b/frontend/appflowy_web_app/src-tauri/src/init.rs@@ -30,6 +30,7 @@ pub fn init_flowy_core() -> AppFlowyCore {let config: tauri_utils::config::Config = serde_json::from_str(config_json).unwrap();let app_version = config.package.version.clone().map(|v| v.to_string()).unwrap_or_else(|| "0.0.0".to_string());+ let app_version = semver::Version::parse(&app_version).unwrap_or_else(|_| semver::Version::new(0, 5, 8));let mut data_path = tauri::api::path::app_local_data_dir(&config).unwrap();if cfg!(debug_assertions) {data_path.push("data_dev");diff --git a/frontend/rust-lib/Cargo.lock b/frontend/rust-lib/Cargo.lockindex 0560f222de..d9a9d047e5 100644--- a/frontend/rust-lib/Cargo.lock+++ b/frontend/rust-lib/Cargo.lock@@ -1218,6 +1218,7 @@ dependencies = ["lib-log","parking_lot 0.12.1","protobuf",+ "semver","serde","serde_json","serde_repr",@@ -1509,6 +1510,7 @@ dependencies = ["parking_lot 0.12.1","protobuf","rand 0.8.5",+ "semver","serde","serde_json","strum",@@ -2035,6 +2037,7 @@ dependencies = ["postgrest","rand 0.8.5","reqwest",+ "semver","serde","serde_json","thiserror",@@ -4800,9 +4803,9 @@ dependencies = [[[package]]name = "semver"-version = "1.0.22"+version = "1.0.23"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca"+checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b"[[package]]name = "serde"diff --git a/frontend/rust-lib/dart-ffi/Cargo.toml b/frontend/rust-lib/dart-ffi/Cargo.tomlindex 4e5148da95..e17ede23e5 100644--- a/frontend/rust-lib/dart-ffi/Cargo.toml+++ b/frontend/rust-lib/dart-ffi/Cargo.toml@@ -25,6 +25,7 @@ lazy_static = "1.4.0"parking_lot.workspace = truetracing.workspace = truelib-log.workspace = true+semver = "1.0.22"# workspacelib-dispatch = { workspace = true }diff --git a/frontend/rust-lib/dart-ffi/src/lib.rs b/frontend/rust-lib/dart-ffi/src/lib.rsindex 48f3e485a2..a7f3e2ee19 100644--- a/frontend/rust-lib/dart-ffi/src/lib.rs+++ b/frontend/rust-lib/dart-ffi/src/lib.rs@@ -1,11 +1,11 @@#![allow(clippy::not_unsafe_ptr_arg_deref)]use allo_isolate::Isolate;-use std::sync::Arc;-use std::{ffi::CStr, os::raw::c_char};-use lazy_static::lazy_static;use parking_lot::Mutex;+use semver::Version;+use std::sync::Arc;+use std::{ffi::CStr, os::raw::c_char};use tracing::{debug, error, info, trace, warn};use flowy_core::config::AppFlowyCoreConfig;@@ -67,8 +67,16 @@ pub extern "C" fn init_sdk(_port: i64, data: *mut c_char) -> i64 {let _ = save_appflowy_cloud_config(&configuration.root, &configuration.appflowy_cloud_config);}+ let mut app_version =+ Version::parse(&configuration.app_version).unwrap_or_else(|_| Version::new(0, 5, 8));++ let min_version = Version::new(0, 5, 8);+ if app_version < min_version {+ app_version = min_version;+ }+let config = AppFlowyCoreConfig::new(- configuration.app_version,+ app_version,configuration.custom_app_path,configuration.origin_app_path,configuration.device_id,diff --git a/frontend/rust-lib/event-integration-test/Cargo.toml b/frontend/rust-lib/event-integration-test/Cargo.tomlindex 26d561e993..d427a8f16c 100644--- a/frontend/rust-lib/event-integration-test/Cargo.toml+++ b/frontend/rust-lib/event-integration-test/Cargo.toml@@ -24,6 +24,7 @@ flowy-notification = { workspace = true }anyhow.workspace = trueflowy-storage = { workspace = true }flowy-search = { workspace = true }+semver = "1.0.23"serde.workspace = trueserde_json.workspace = truediff --git a/frontend/rust-lib/event-integration-test/src/lib.rs b/frontend/rust-lib/event-integration-test/src/lib.rsindex 180623d8d5..cddd304dde 100644--- a/frontend/rust-lib/event-integration-test/src/lib.rs+++ b/frontend/rust-lib/event-integration-test/src/lib.rs@@ -10,6 +10,7 @@ use std::time::Duration;use nanoid::nanoid;use parking_lot::RwLock;+use semver::Version;use tokio::select;use tokio::time::sleep;@@ -55,7 +56,7 @@ impl EventIntegrationTest {let device_id = uuid::Uuid::new_v4().to_string();let config = AppFlowyCoreConfig::new(- "".to_string(),+ Version::new(0, 5, 8),path.clone(),path,device_id,diff --git a/frontend/rust-lib/flowy-core/src/config.rs b/frontend/rust-lib/flowy-core/src/config.rsindex 53919ad9b0..fd8fbe335f 100644--- a/frontend/rust-lib/flowy-core/src/config.rs+++ b/frontend/rust-lib/flowy-core/src/config.rs@@ -2,6 +2,7 @@ use std::fmt;use std::path::Path;use base64::Engine;+use semver::Version;use tracing::{error, info};use flowy_server_pub::af_cloud_config::AFCloudConfiguration;@@ -15,7 +16,7 @@ use crate::integrate::log::create_log_filter;#[derive(Clone)]pub struct AppFlowyCoreConfig {/// Different `AppFlowyCoreConfig` instance should have different name- pub(crate) app_version: String,+ pub(crate) app_version: Version,pub name: String,pub(crate) device_id: String,pub platform: String,@@ -75,7 +76,7 @@ fn make_user_data_folder(root: &str, url: &str) -> String {impl AppFlowyCoreConfig {pub fn new(- app_version: String,+ app_version: Version,custom_application_path: String,application_path: String,device_id: String,diff --git a/frontend/rust-lib/flowy-core/src/integrate/server.rs b/frontend/rust-lib/flowy-core/src/integrate/server.rsindex b0c0acbdcf..2959ae7f21 100644--- a/frontend/rust-lib/flowy-core/src/integrate/server.rs+++ b/frontend/rust-lib/flowy-core/src/integrate/server.rs@@ -133,7 +133,7 @@ impl ServerProvider {config,*self.user_enable_sync.read(),self.config.device_id.clone(),- &self.config.app_version,+ self.config.app_version.clone(),self.user.clone(),));diff --git a/frontend/rust-lib/flowy-core/src/lib.rs b/frontend/rust-lib/flowy-core/src/lib.rsindex 36addf0fe7..2ba29b83fd 100644--- a/frontend/rust-lib/flowy-core/src/lib.rs+++ b/frontend/rust-lib/flowy-core/src/lib.rs@@ -3,7 +3,6 @@use flowy_search::folder::indexer::FolderIndexManagerImpl;use flowy_search::services::manager::SearchManager;use flowy_storage::ObjectStorageService;-use semver::Version;use std::sync::{Arc, Weak};use std::time::Duration;use sysinfo::System;@@ -106,13 +105,12 @@ impl AppFlowyCore {let task_dispatcher = Arc::new(RwLock::new(task_scheduler));runtime.spawn(TaskRunner::run(task_dispatcher.clone()));- let app_version = Version::parse(&config.app_version).unwrap_or_else(|_| Version::new(0, 5, 4));let user_config = UserConfig::new(&config.name,&config.storage_path,&config.application_path,&config.device_id,- app_version,+ config.app_version.clone(),);let authenticate_user = Arc::new(AuthenticateUser::new(diff --git a/frontend/rust-lib/flowy-server/Cargo.toml b/frontend/rust-lib/flowy-server/Cargo.tomlindex b64b30fa49..d11cb2b594 100644--- a/frontend/rust-lib/flowy-server/Cargo.toml+++ b/frontend/rust-lib/flowy-server/Cargo.toml@@ -48,6 +48,7 @@ tokio-stream = { workspace = true, features = ["sync"] }lib-dispatch = { workspace = true }yrs.workspace = truerand = "0.8.5"+semver = "1.0.23"[dependencies.client-api]workspace = truediff --git a/frontend/rust-lib/flowy-server/src/af_cloud/server.rs b/frontend/rust-lib/flowy-server/src/af_cloud/server.rsindex 1fd6a5b03f..c758be253a 100644--- a/frontend/rust-lib/flowy-server/src/af_cloud/server.rs+++ b/frontend/rust-lib/flowy-server/src/af_cloud/server.rs@@ -12,6 +12,7 @@ use client_api::ws::{use client_api::{Client, ClientConfiguration};use flowy_storage::ObjectStorageService;use rand::Rng;+use semver::Version;use tokio::select;use tokio::sync::{watch, Mutex};use tokio_stream::wrappers::WatchStream;@@ -53,7 +54,7 @@ impl AppFlowyCloudServer {config: AFCloudConfiguration,enable_sync: bool,mut device_id: String,- client_version: &str,+ client_version: Version,user: Arc<dyn ServerUser>,) -> Self {// The device id can't be empty, so we generate a new one if it is.@@ -70,7 +71,7 @@ impl AppFlowyCloudServer {ClientConfiguration::default().with_compression_buffer_size(10240).with_compression_quality(8),- client_version,+ &client_version.to_string(),);let token_state_rx = api_client.subscribe_token_state();let enable_sync = Arc::new(AtomicBool::new(enable_sync));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 224e10cd95..71dacfab04 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,4 +1,5 @@use client_api::ClientConfiguration;+use semver::Version;use std::collections::HashMap;use std::sync::Arc;@@ -32,7 +33,7 @@ pub fn af_cloud_server(config: AFCloudConfiguration) -> Arc<AppFlowyCloudServer>config,true,fake_device_id,- "0.5.1",+ Version::new(0, 5, 8),Arc::new(FakeServerUserImpl),))}