chore: Upgrade the collab library to fix the issue with importing Notion zip files that contain embedded zip attachments. (#955)

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

* chore: fix compile
This commit is contained in:
Nathan.fooo 2024-11-01 22:26:27 +08:00 committed by GitHub
parent 3f3439b498
commit 7c42cee11a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 34 additions and 31 deletions

14
Cargo.lock generated
View File

@ -2240,7 +2240,7 @@ dependencies = [
[[package]]
name = "collab"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=ae51ebef5cfc9805d58e89adca2cff9ea6e0b730#ae51ebef5cfc9805d58e89adca2cff9ea6e0b730"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=4175465382020f1bd9cd9aa0e0766178eac7b4e5#4175465382020f1bd9cd9aa0e0766178eac7b4e5"
dependencies = [
"anyhow",
"arc-swap",
@ -2265,7 +2265,7 @@ dependencies = [
[[package]]
name = "collab-database"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=ae51ebef5cfc9805d58e89adca2cff9ea6e0b730#ae51ebef5cfc9805d58e89adca2cff9ea6e0b730"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=4175465382020f1bd9cd9aa0e0766178eac7b4e5#4175465382020f1bd9cd9aa0e0766178eac7b4e5"
dependencies = [
"anyhow",
"async-trait",
@ -2304,7 +2304,7 @@ dependencies = [
[[package]]
name = "collab-document"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=ae51ebef5cfc9805d58e89adca2cff9ea6e0b730#ae51ebef5cfc9805d58e89adca2cff9ea6e0b730"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=4175465382020f1bd9cd9aa0e0766178eac7b4e5#4175465382020f1bd9cd9aa0e0766178eac7b4e5"
dependencies = [
"anyhow",
"arc-swap",
@ -2325,7 +2325,7 @@ dependencies = [
[[package]]
name = "collab-entity"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=ae51ebef5cfc9805d58e89adca2cff9ea6e0b730#ae51ebef5cfc9805d58e89adca2cff9ea6e0b730"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=4175465382020f1bd9cd9aa0e0766178eac7b4e5#4175465382020f1bd9cd9aa0e0766178eac7b4e5"
dependencies = [
"anyhow",
"bytes",
@ -2345,7 +2345,7 @@ dependencies = [
[[package]]
name = "collab-folder"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=ae51ebef5cfc9805d58e89adca2cff9ea6e0b730#ae51ebef5cfc9805d58e89adca2cff9ea6e0b730"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=4175465382020f1bd9cd9aa0e0766178eac7b4e5#4175465382020f1bd9cd9aa0e0766178eac7b4e5"
dependencies = [
"anyhow",
"arc-swap",
@ -2367,7 +2367,7 @@ dependencies = [
[[package]]
name = "collab-importer"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=ae51ebef5cfc9805d58e89adca2cff9ea6e0b730#ae51ebef5cfc9805d58e89adca2cff9ea6e0b730"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=4175465382020f1bd9cd9aa0e0766178eac7b4e5#4175465382020f1bd9cd9aa0e0766178eac7b4e5"
dependencies = [
"anyhow",
"async-recursion",
@ -2470,7 +2470,7 @@ dependencies = [
[[package]]
name = "collab-user"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=ae51ebef5cfc9805d58e89adca2cff9ea6e0b730#ae51ebef5cfc9805d58e89adca2cff9ea6e0b730"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=4175465382020f1bd9cd9aa0e0766178eac7b4e5#4175465382020f1bd9cd9aa0e0766178eac7b4e5"
dependencies = [
"anyhow",
"collab",

View File

@ -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 = []

View File

@ -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,
@ -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,
@ -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,
@ -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,

View File

@ -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)

View File

@ -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
@ -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,

View File

@ -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();
@ -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;
@ -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);