From e85dbe724c9c8eb74a65c6aff59e96be23739948 Mon Sep 17 00:00:00 2001 From: "Nathan.fooo" <86001920+appflowy@users.noreply.github.com> Date: Tue, 21 May 2024 14:41:47 +0800 Subject: [PATCH] chore: add limitation when importing csv file (#5381) --- frontend/rust-lib/flowy-database2/src/manager.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/rust-lib/flowy-database2/src/manager.rs b/frontend/rust-lib/flowy-database2/src/manager.rs index 77d9a477bc..283ad989c1 100644 --- a/frontend/rust-lib/flowy-database2/src/manager.rs +++ b/frontend/rust-lib/flowy-database2/src/manager.rs @@ -347,6 +347,12 @@ impl DatabaseManager { }) .await .map_err(internal_error)??; + + // Currently, we only support importing up to 500 rows. We can support more rows in the future. + if !cfg!(debug_assertions) && params.rows.len() > 500 { + return Err(FlowyError::internal().with_context("The number of rows exceeds the limit")); + } + let result = ImportResult { database_id: params.database_id.clone(), view_id: params.inline_view_id.clone(),