fix: delete workspace no panic (#4832)

This commit is contained in:
Zack 2024-03-07 10:15:50 +08:00 committed by GitHub
parent 90ebcb4cfc
commit 88d14e7bde
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,7 +3,7 @@ use std::sync::Arc;
use collab_entity::{CollabObject, CollabType}; use collab_entity::{CollabObject, CollabType};
use collab_integrate::CollabKVDB; use collab_integrate::CollabKVDB;
use tracing::{error, info, instrument}; use tracing::{error, info, instrument, warn};
use flowy_error::{FlowyError, FlowyResult}; use flowy_error::{FlowyError, FlowyResult};
use flowy_folder_pub::entities::{AppFlowyData, ImportData}; 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)?; .execute(conn)?;
Ok::<usize, FlowyError>(rows_affected) Ok::<usize, FlowyError>(rows_affected)
})?; })?;
assert_eq!(n, 1); if n != 1 {
warn!("expected to delete 1 row, but deleted {} rows", n);
}
Ok(()) Ok(())
} }