chore: check workspace id before write to disk (#5197)

* chore: check workspace id before write to disk

* chore: update logs

* chore: update logs

* chore: update ci

* chore: bump client api
This commit is contained in:
Nathan.fooo
2024-04-24 14:38:47 +08:00
committed by GitHub
parent d21d095f0b
commit 6ecbf971b2
25 changed files with 204 additions and 142 deletions

View File

@ -3,7 +3,7 @@ use client_api::entity::QueryCollabResult::{Failed, Success};
use client_api::entity::{QueryCollab, QueryCollabParams};
use client_api::error::ErrorCode::RecordNotFound;
use collab::core::collab::DataSource;
use collab::core::collab_plugin::EncodedCollab;
use collab::entity::EncodedCollab;
use collab_entity::CollabType;
use tracing::error;
@ -36,7 +36,7 @@ where
},
};
match try_get_client?.get_collab(params).await {
Ok(data) => Ok(Some(data.doc_state.to_vec())),
Ok(data) => Ok(Some(data.encode_collab.doc_state.to_vec())),
Err(err) => {
if err.code == RecordNotFound {
Ok(None)

View File

@ -37,6 +37,7 @@ where
.get_collab(params)
.await
.map_err(FlowyError::from)?
.encode_collab
.doc_state
.to_vec();
Ok(doc_state)
@ -72,6 +73,7 @@ where
.get_collab(params)
.await
.map_err(FlowyError::from)?
.encode_collab
.doc_state
.to_vec();
let document = Document::from_doc_state(

View File

@ -94,6 +94,7 @@ where
.get_collab(params)
.await
.map_err(FlowyError::from)?
.encode_collab
.doc_state
.to_vec();
let folder = Folder::from_collab_doc_state(
@ -137,6 +138,7 @@ where
.get_collab(params)
.await
.map_err(FlowyError::from)?
.encode_collab
.doc_state
.to_vec();
Ok(doc_state)

View File

@ -334,7 +334,7 @@ where
};
let resp = try_get_client?.get_collab(params).await?;
Ok(resp.doc_state.to_vec())
Ok(resp.encode_collab.doc_state.to_vec())
})
}