aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-01 22:31:49 +0100
committertv <tv@krebsco.de>2026-11-01 22:31:49 +0100
commitd7433f9d34c299e7ce31542aede80d2530c1e45f (patch)
treee6653872b6822a1b04523d8b8444b75d972ba783 /src/swarm
parent3e115a7e9cc5846d6c1025a7297a006c2d64709b (diff)
document: introduce patch log
Diffstat (limited to 'src/swarm')
-rw-r--r--src/swarm/changes.rs4
-rw-r--r--src/swarm/sync.rs6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/swarm/changes.rs b/src/swarm/changes.rs
index 8565cb6..0f22f52 100644
--- a/src/swarm/changes.rs
+++ b/src/swarm/changes.rs
@@ -8,7 +8,7 @@ use std::sync::Arc;
use tracing::{info, warn};
use crate::document::changes;
-use crate::document::store::{self, ChangeSet, InLists};
+use crate::document::store::{ChangeSet, InLists};
use crate::state::AppState;
pub(crate) async fn run_change_publisher(state: AppState) {
@@ -37,7 +37,7 @@ pub(crate) async fn run_change_publisher(state: AppState) {
let mut paths = Vec::new();
let mut conflicts = Vec::new();
- for changed in store::changed(&replica.doc, &before, &heads, InLists::Index) {
+ for changed in replica.changed_since(&before, InLists::Index) {
if changed.conflict {
conflicts.push(changed.path.clone());
}
diff --git a/src/swarm/sync.rs b/src/swarm/sync.rs
index b881609..3bfbf7d 100644
--- a/src/swarm/sync.rs
+++ b/src/swarm/sync.rs
@@ -389,9 +389,9 @@ pub(crate) async fn handle_sync(
peer_state.reports_ready = Some(from_ready);
let heads_before = replica.heads().to_vec();
- peer_state
- .sync
- .receive(&mut replica.doc, message)
+ let sync = &mut peer_state.sync;
+ replica
+ .logged(|doc, log| (sync.receive_logged(doc, message, log), true))
.context("Automerge sync failed")?;
peer_state.last_sync_rx = Some(Instant::now());
if let Some(wait) = &peer_state.sync.reply {