From 52e307d7b95dda735d1afbc4fe2dcffaa87512a4 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 5 Nov 2026 00:29:56 +0100 Subject: delta from held heads --- src/swarm/sync.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/swarm/sync.rs') diff --git a/src/swarm/sync.rs b/src/swarm/sync.rs index 3cbead1..2a08aae 100644 --- a/src/swarm/sync.rs +++ b/src/swarm/sync.rs @@ -162,6 +162,7 @@ async fn deliver_sync_to_peer(state: &AppState, peer: &str) -> Result<()> { // (it didn't answer in time): offered again without generating the // message it replaces, which may take seconds when large. let again = peer_state.sync.offer_again( + &replica.doc, replica.heads(), delta_threshold, Instant::now(), @@ -186,7 +187,9 @@ async fn deliver_sync_to_peer(state: &AppState, peer: &str) -> Result<()> { // Too large for one message: all or nothing, and on a slow link // within the transport's delivery limit. The peer fetches it in // chunks. - let from = peer_state.sync.withdraw_for_delta(Instant::now()); + let from = peer_state + .sync + .withdraw_for_delta(&replica.doc, Instant::now()); let spec = transport::DeltaSpec::new(from, replica.heads().to_vec()); if spec.to.iter().all(|head| spec.from.contains(head)) { // It has our heads: nothing to offer (Automerge thought it -- cgit v1.3.1