mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: stuck when importing large csv file (#4878)
* chore: fix import csv file * chore: update collab * chore: bump collab * chore: workaround for row creating * fix: test
This commit is contained in:
@ -8,6 +8,7 @@ use flowy_user::entities::{
|
||||
};
|
||||
use flowy_user::errors::FlowyError;
|
||||
use flowy_user::event_map::UserEvent;
|
||||
use tokio::time::sleep;
|
||||
|
||||
use crate::event_builder::EventBuilder;
|
||||
use crate::EventIntegrationTest;
|
||||
@ -134,6 +135,15 @@ impl EventIntegrationTest {
|
||||
.await
|
||||
.parse::<ViewPB>()
|
||||
}
|
||||
|
||||
pub async fn import_data(&self, data: ImportPB) -> ViewPB {
|
||||
EventBuilder::new(self.clone())
|
||||
.event(FolderEvent::ImportData)
|
||||
.payload(data)
|
||||
.async_send()
|
||||
.await
|
||||
.parse::<ViewPB>()
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ViewTest {
|
||||
@ -172,15 +182,23 @@ impl ViewTest {
|
||||
}
|
||||
|
||||
pub async fn new_grid_view(sdk: &EventIntegrationTest, data: Vec<u8>) -> Self {
|
||||
Self::new(sdk, ViewLayoutPB::Grid, data).await
|
||||
// TODO(nathan): remove this sleep
|
||||
// workaround for the rows that are created asynchronously
|
||||
let this = Self::new(sdk, ViewLayoutPB::Grid, data).await;
|
||||
sleep(tokio::time::Duration::from_secs(2)).await;
|
||||
this
|
||||
}
|
||||
|
||||
pub async fn new_board_view(sdk: &EventIntegrationTest, data: Vec<u8>) -> Self {
|
||||
Self::new(sdk, ViewLayoutPB::Board, data).await
|
||||
let this = Self::new(sdk, ViewLayoutPB::Board, data).await;
|
||||
sleep(tokio::time::Duration::from_secs(2)).await;
|
||||
this
|
||||
}
|
||||
|
||||
pub async fn new_calendar_view(sdk: &EventIntegrationTest, data: Vec<u8>) -> Self {
|
||||
Self::new(sdk, ViewLayoutPB::Calendar, data).await
|
||||
let this = Self::new(sdk, ViewLayoutPB::Calendar, data).await;
|
||||
sleep(tokio::time::Duration::from_secs(2)).await;
|
||||
this
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user