fix: send only delta patches via DiamondTypes

This commit is contained in:
əlemi 2025-01-13 12:37:58 +01:00
parent 362a9689a4
commit 32255bec55
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -1,6 +1,6 @@
use std::sync::Arc; use std::sync::Arc;
use diamond_types::list::encoding::EncodeOptions; use diamond_types::list::encoding::ENCODE_PATCH;
use diamond_types::list::{Branch, OpLog}; use diamond_types::list::{Branch, OpLog};
use diamond_types::LocalVersion; use diamond_types::LocalVersion;
use tokio::sync::{mpsc, oneshot, watch}; use tokio::sync::{mpsc, oneshot, watch};
@ -192,7 +192,7 @@ impl BufferWorker {
if change.is_delete() || change.is_insert() { if change.is_delete() || change.is_insert() {
tx.send(Operation { tx.send(Operation {
data: self.oplog.encode_from(EncodeOptions::default(), &last_ver), data: self.oplog.encode_from(ENCODE_PATCH, &last_ver),
}) })
.await .await
.unwrap_or_warn("failed to send change!"); .unwrap_or_warn("failed to send change!");