chore: remove unused features (#5196)

* chore: remove unused features

* chore: update logs
This commit is contained in:
Nathan.fooo
2024-04-24 10:26:58 +08:00
committed by GitHub
parent 9aaada961f
commit 77d600a742
14 changed files with 137 additions and 141 deletions

View File

@ -7,7 +7,7 @@ edition = "2018"
[dependencies]
flowy-derive.workspace = true
flowy-sqlite = { workspace = true, optional = true }
flowy-sqlite = { workspace = true }
flowy-encrypt = { workspace = true }
flowy-error = { workspace = true, features = ["impl_from_dispatch_error", "impl_from_sqlite", "impl_from_collab_folder", "impl_from_collab_persistence"] }
flowy-folder-pub = { workspace = true }
@ -57,8 +57,6 @@ rand_core = "0.6.2"
quickcheck_macros = "1.0"
[features]
default = ["rev-sqlite"]
rev-sqlite = ["flowy-sqlite"]
dart = ["flowy-codegen/dart", "flowy-notification/dart"]
tauri_ts = ["flowy-codegen/ts", "flowy-notification/tauri_ts"]

View File

@ -133,6 +133,7 @@ impl UserManager {
if let Ok(session) = self.get_session() {
let user = self.get_user_profile_from_disk(session.user_id).await?;
// Get the current authenticator from the environment variable
let current_authenticator = current_authenticator();
@ -151,9 +152,10 @@ impl UserManager {
event!(
tracing::Level::INFO,
"init user session: {}:{}",
"init user session: {}:{}, authenticator: {:?}",
user.uid,
user.email
user.email,
user.authenticator,
);
self.prepare_user(&session).await;

View File

@ -159,6 +159,7 @@ impl UserManager {
Ok(())
}
#[instrument(level = "info", skip(self), err)]
pub async fn add_workspace(&self, workspace_name: &str) -> FlowyResult<UserWorkspace> {
let new_workspace = self
.cloud_services
@ -166,6 +167,11 @@ impl UserManager {
.create_workspace(workspace_name)
.await?;
info!(
"new workspace: {}, name:{}",
new_workspace.id, new_workspace.name
);
// save the workspace to sqlite db
let uid = self.user_id()?;
let mut conn = self.db_connection(uid)?;
@ -208,7 +214,9 @@ impl UserManager {
save_user_workspaces(uid, conn, &[user_workspace])
}
#[instrument(level = "info", skip(self), err)]
pub async fn leave_workspace(&self, workspace_id: &str) -> FlowyResult<()> {
info!("leave workspace: {}", workspace_id);
self
.cloud_services
.get_user_service()?
@ -221,7 +229,9 @@ impl UserManager {
delete_user_workspaces(conn, workspace_id)
}
#[instrument(level = "info", skip(self), err)]
pub async fn delete_workspace(&self, workspace_id: &str) -> FlowyResult<()> {
info!("delete workspace: {}", workspace_id);
self
.cloud_services
.get_user_service()?