Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

fix: prevent segfault due to infinite recursion in trash view

khorshuhengcbdac7102564
diff --git a/frontend/rust-lib/flowy-folder/src/manager.rs b/frontend/rust-lib/flowy-folder/src/manager.rs
index b9e41f2998..e2ec405884 100644
--- a/frontend/rust-lib/flowy-folder/src/manager.rs
+++ b/frontend/rust-lib/flowy-folder/src/manager.rs
@@ -2074,16 +2074,11 @@ pub(crate) fn get_workspace_public_view_pbs(workspace_id: &str, folder: &Folder)
/// Get all the child views belong to the view id, including the child views of the child views.
fn get_all_child_view_ids(folder: &Folder, view_id: &str) -> Vec<String> {
- let child_view_ids = folder
- .get_views_belong_to(view_id)
- .into_iter()
+ folder
+ .get_view_recursively(view_id)
+ .iter()
.map(|view| view.id.clone())
- .collect::<Vec<String>>();
- let mut all_child_view_ids = child_view_ids.clone();
- for child_view_id in child_view_ids {
- all_child_view_ids.extend(get_all_child_view_ids(folder, &child_view_id));
- }
- all_child_view_ids
+ .collect()
}
/// Get the current private views of the user.