From 88d14e7bdec1710bec26cd33014e205d4b576beb Mon Sep 17 00:00:00 2001 From: Zack Date: Thu, 7 Mar 2024 10:15:50 +0800 Subject: [PATCH] fix: delete workspace no panic (#4832) --- .../flowy-user/src/user_manager/manager_user_workspace.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/rust-lib/flowy-user/src/user_manager/manager_user_workspace.rs b/frontend/rust-lib/flowy-user/src/user_manager/manager_user_workspace.rs index dfed83ccfe..f94f955ba9 100644 --- a/frontend/rust-lib/flowy-user/src/user_manager/manager_user_workspace.rs +++ b/frontend/rust-lib/flowy-user/src/user_manager/manager_user_workspace.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use collab_entity::{CollabObject, CollabType}; use collab_integrate::CollabKVDB; -use tracing::{error, info, instrument}; +use tracing::{error, info, instrument, warn}; use flowy_error::{FlowyError, FlowyResult}; use flowy_folder_pub::entities::{AppFlowyData, ImportData}; @@ -336,6 +336,8 @@ pub fn delete_user_workspaces(mut conn: DBConnection, workspace_id: &str) -> Flo .execute(conn)?; Ok::(rows_affected) })?; - assert_eq!(n, 1); + if n != 1 { + warn!("expected to delete 1 row, but deleted {} rows", n); + } Ok(()) }