Skip to content

Commit

Permalink
chore: Upgrade the collab library to fix the issue with importing Not…
Browse files Browse the repository at this point in the history
…ion zip files that contain embedded zip attachments. (#955)

* chore: bump collab that fixs import notion zip file contains zip attachment

* chore: fix compile
  • Loading branch information
appflowy authored Nov 1, 2024
1 parent 3f3439b commit 7c42cee
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 31 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,13 @@ debug = true
[patch.crates-io]
# It's diffcult to resovle different version with the same crate used in AppFlowy Frontend and the Client-API crate.
# So using patch to workaround this issue.
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "ae51ebef5cfc9805d58e89adca2cff9ea6e0b730" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "ae51ebef5cfc9805d58e89adca2cff9ea6e0b730" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "ae51ebef5cfc9805d58e89adca2cff9ea6e0b730" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "ae51ebef5cfc9805d58e89adca2cff9ea6e0b730" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "ae51ebef5cfc9805d58e89adca2cff9ea6e0b730" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "ae51ebef5cfc9805d58e89adca2cff9ea6e0b730" }
collab-importer = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "ae51ebef5cfc9805d58e89adca2cff9ea6e0b730" }
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "4175465382020f1bd9cd9aa0e0766178eac7b4e5" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "4175465382020f1bd9cd9aa0e0766178eac7b4e5" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "4175465382020f1bd9cd9aa0e0766178eac7b4e5" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "4175465382020f1bd9cd9aa0e0766178eac7b4e5" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "4175465382020f1bd9cd9aa0e0766178eac7b4e5" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "4175465382020f1bd9cd9aa0e0766178eac7b4e5" }
collab-importer = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "4175465382020f1bd9cd9aa0e0766178eac7b4e5" }

[features]
history = []
Expand Down
8 changes: 0 additions & 8 deletions libs/workspace-template/src/hierarchy_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ pub struct ViewBuilder {
parent_view_id: String,
view_id: String,
name: String,
desc: String,
layout: ViewLayout,
child_views: Vec<ParentChildViews>,
is_favorite: bool,
Expand All @@ -59,7 +58,6 @@ impl ViewBuilder {
parent_view_id,
view_id: gen_view_id().to_string(),
name: Default::default(),
desc: Default::default(),
layout: ViewLayout::Document,
child_views: vec![],
is_favorite: false,
Expand Down Expand Up @@ -87,11 +85,6 @@ impl ViewBuilder {
self
}

pub fn with_desc(mut self, desc: &str) -> Self {
self.desc = desc.to_string();
self
}

pub fn with_icon(mut self, icon: &str) -> Self {
self.icon = Some(ViewIcon {
ty: IconType::Emoji,
Expand Down Expand Up @@ -122,7 +115,6 @@ impl ViewBuilder {
id: self.view_id,
parent_view_id: self.parent_view_id,
name: self.name,
desc: self.desc,
created_at: timestamp(),
is_favorite: self.is_favorite,
layout: self.layout,
Expand Down
8 changes: 6 additions & 2 deletions src/biz/workspace/page_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,12 @@ async fn get_page_collab_data_for_database(
),
)
})?;
let db_body = DatabaseBody::from_collab(&db_collab, Arc::new(NoPersistenceDatabaseCollabService))
.ok_or_else(|| AppError::RecordNotFound("no database body found".to_string()))?;
let db_body = DatabaseBody::from_collab(
&db_collab,
Arc::new(NoPersistenceDatabaseCollabService),
None,
)
.ok_or_else(|| AppError::RecordNotFound("no database body found".to_string()))?;
let inline_view_id = {
let txn = db_collab.transact();
db_body.get_inline_view_id(&txn)
Expand Down
10 changes: 6 additions & 4 deletions src/biz/workspace/publish_dup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,9 +726,12 @@ impl PublishCollabDuplicator {
) -> Result<(String, String, bool), AppError> {
// collab of database
let mut db_collab = collab_from_doc_state(published_db.database_collab.clone(), "")?;
let db_body =
DatabaseBody::from_collab(&db_collab, Arc::new(NoPersistenceDatabaseCollabService))
.ok_or_else(|| AppError::RecordNotFound("no database body found".to_string()))?;
let db_body = DatabaseBody::from_collab(
&db_collab,
Arc::new(NoPersistenceDatabaseCollabService),
None,
)
.ok_or_else(|| AppError::RecordNotFound("no database body found".to_string()))?;
let pub_db_id = db_body.get_database_id(&db_collab.context.transact());

// check if the database is already duplicated
Expand Down Expand Up @@ -1115,7 +1118,6 @@ impl PublishCollabDuplicator {
id: new_view_id,
parent_view_id: "".to_string(), // to be filled by caller
name: view_info.name.clone(),
desc: "".to_string(), // unable to get from metadata
children: RepeatedViewIdentifier { items: vec![] }, // fill in while iterating children
created_at: self.ts_now,
is_favorite: false,
Expand Down
11 changes: 8 additions & 3 deletions tests/workspace/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1313,6 +1313,7 @@ async fn duplicate_to_workspace_db_with_relation() {
let rel_col_db_body = DatabaseBody::from_collab(
&db_with_rel_col_collab,
Arc::new(NoPersistenceDatabaseCollabService),
None,
)
.unwrap();
let txn = db_with_rel_col_collab.transact();
Expand Down Expand Up @@ -1387,9 +1388,12 @@ async fn duplicate_to_workspace_db_row_with_doc() {
.get_db_collab_from_view(&workspace_id_2, &db_with_row_doc.view_id)
.await;

let db_body =
DatabaseBody::from_collab(&db_collab, Arc::new(NoPersistenceDatabaseCollabService))
.unwrap();
let db_body = DatabaseBody::from_collab(
&db_collab,
Arc::new(NoPersistenceDatabaseCollabService),
None,
)
.unwrap();

// check that doc exists and can be fetched
let first_row_id = &db_body.views.get_all_views(&db_collab.transact())[0].row_orders[0].id;
Expand Down Expand Up @@ -1472,6 +1476,7 @@ async fn duplicate_to_workspace_db_rel_self() {
let db_rel_self_body = DatabaseBody::from_collab(
&db_rel_self_collab,
Arc::new(NoPersistenceDatabaseCollabService),
None,
)
.unwrap();
let database_id = db_rel_self_body.get_database_id(&txn);
Expand Down

0 comments on commit 7c42cee

Please sign in to comment.