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

@ -95,6 +95,9 @@ pub(crate) async fn apply_action_handler(
let doc_id = params.document_id;
let document = manager.get_document(&doc_id).await?;
let actions = params.actions;
if cfg!(feature = "verbose_log") {
tracing::trace!("{} applying actions: {:?}", doc_id, actions);
}
document.lock().apply_action(actions);
Ok(())
}
@ -125,6 +128,9 @@ pub(crate) async fn apply_text_delta_handler(
let text_id = params.text_id;
let delta = params.delta;
let document = document.lock();
if cfg!(feature = "verbose_log") {
tracing::trace!("{} applying delta: {:?}", doc_id, delta);
}
document.apply_text_delta(&text_id, delta);
Ok(())
}

View File

@ -2,8 +2,8 @@ use std::sync::Arc;
use std::sync::Weak;
use collab::core::collab::{DataSource, MutexCollab};
use collab::core::collab_plugin::EncodedCollab;
use collab::core::origin::CollabOrigin;
use collab::entity::EncodedCollab;
use collab::preclude::Collab;
use collab_document::blocks::DocumentData;
use collab_document::document::Document;