diff --git a/Cargo.lock b/Cargo.lock index 4030cdf5..daebaf27 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1648,7 +1648,7 @@ dependencies = [ [[package]] name = "collab" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cabc2b5d3e677393e5e7501bc07eb17b7b1643e6#cabc2b5d3e677393e5e7501bc07eb17b7b1643e6" dependencies = [ "anyhow", "async-trait", @@ -1672,7 +1672,7 @@ dependencies = [ [[package]] name = "collab-document" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cabc2b5d3e677393e5e7501bc07eb17b7b1643e6#cabc2b5d3e677393e5e7501bc07eb17b7b1643e6" dependencies = [ "anyhow", "collab", @@ -1691,7 +1691,7 @@ dependencies = [ [[package]] name = "collab-entity" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cabc2b5d3e677393e5e7501bc07eb17b7b1643e6#cabc2b5d3e677393e5e7501bc07eb17b7b1643e6" dependencies = [ "anyhow", "bytes", @@ -1706,7 +1706,7 @@ dependencies = [ [[package]] name = "collab-folder" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=3f7bc378af0ee5ca4e25e4746acaa66fab6df79f#3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cabc2b5d3e677393e5e7501bc07eb17b7b1643e6#cabc2b5d3e677393e5e7501bc07eb17b7b1643e6" dependencies = [ "anyhow", "chrono", diff --git a/Cargo.toml b/Cargo.toml index b4e648f9..5ecfd5de 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -209,10 +209,10 @@ debug = true # will be removed when using yrs 0.18.2 that expose pendings yrs = { git = "https://github.com/appflowy/y-crdt", rev = "3f25bb510ca5274e7657d3713fbed41fb46b4487" } -collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" } -collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" } -collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" } -collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "3f7bc378af0ee5ca4e25e4746acaa66fab6df79f" } +collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cabc2b5d3e677393e5e7501bc07eb17b7b1643e6" } +collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cabc2b5d3e677393e5e7501bc07eb17b7b1643e6" } +collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cabc2b5d3e677393e5e7501bc07eb17b7b1643e6" } +collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cabc2b5d3e677393e5e7501bc07eb17b7b1643e6" } [features] ai_enable = [] diff --git a/libs/collab-rt-protocol/src/protocol.rs b/libs/collab-rt-protocol/src/protocol.rs index 95c94d0b..fbc5684a 100644 --- a/libs/collab-rt-protocol/src/protocol.rs +++ b/libs/collab-rt-protocol/src/protocol.rs @@ -1,7 +1,6 @@ use collab::core::awareness::{Awareness, AwarenessUpdate}; use collab::core::collab::{TransactionExt, TransactionMutExt}; use collab::core::origin::CollabOrigin; -use collab::core::transaction::TransactionRetry; use collab::preclude::Collab; use yrs::updates::decoder::Decode; @@ -46,9 +45,9 @@ impl CollabSyncProtocol for ClientSyncProtocol { awareness: &mut Awareness, update: Update, ) -> Result<(), RTProtocolError> { - let mut retry_txn = TransactionRetry::new(awareness.doc()); - let mut txn = retry_txn - .try_get_write_txn_with(origin.clone()) + let mut txn = awareness + .doc() + .try_transact_mut_with(origin.clone()) .map_err(|err| { RTProtocolError::YrsTransaction(format!("sync step2 transaction acquire: {}", err)) })?; diff --git a/services/appflowy-collaborate/src/group/protocol.rs b/services/appflowy-collaborate/src/group/protocol.rs index 8ff388c7..d15ad94f 100644 --- a/services/appflowy-collaborate/src/group/protocol.rs +++ b/services/appflowy-collaborate/src/group/protocol.rs @@ -1,7 +1,7 @@ use collab::core::awareness::Awareness; use collab::core::collab::{TransactionExt, TransactionMutExt}; use collab::core::origin::CollabOrigin; -use collab::core::transaction::TransactionRetry; + use collab_rt_protocol::CollabSyncProtocol; use collab_rt_protocol::{CustomMessage, Message, RTProtocolError, SyncMessage}; @@ -39,9 +39,9 @@ impl CollabSyncProtocol for ServerSyncProtocol { awareness: &mut Awareness, update: Update, ) -> Result<(), RTProtocolError> { - let mut retry_txn = TransactionRetry::new(awareness.doc()); - let mut txn = retry_txn - .try_get_write_txn_with(origin.clone()) + let mut txn = awareness + .doc() + .try_transact_mut_with(origin.clone()) .map_err(|err| { RTProtocolError::YrsTransaction(format!("sync step2 transaction acquire: {}", err)) })?;