diff --git a/frontend/rust-lib/flowy-database2/src/manager.rs b/frontend/rust-lib/flowy-database2/src/manager.rs index 8246da8a97..cf14295e4c 100644 --- a/frontend/rust-lib/flowy-database2/src/manager.rs +++ b/frontend/rust-lib/flowy-database2/src/manager.rs @@ -903,18 +903,21 @@ impl DatabaseCollabService for WorkspaceDatabaseCollabServiceImpl { encoded_collab_by_id.insert(k, v); } - // 2. Fetch remaining collabs from remote - let remote_collabs = self - .batch_get_encode_collab(object_ids, collab_type) - .await?; + if !object_ids.is_empty() { + // 2. Fetch remaining collabs from remote + let remote_collabs = self + .batch_get_encode_collab(object_ids, collab_type) + .await?; - trace!( - "[Database]: load {} database row from remote", - remote_collabs.len() - ); - for (k, v) in remote_collabs { - encoded_collab_by_id.insert(k, v); + trace!( + "[Database]: load {} database row from remote", + remote_collabs.len() + ); + for (k, v) in remote_collabs { + encoded_collab_by_id.insert(k, v); + } } + Ok(encoded_collab_by_id) }