From 12fae75f850c3ca63a68378b2684b5d89f667e10 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 5 Nov 2026 15:59:35 +0100 Subject: offer answers --- src/document/sync.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/document/sync.rs') diff --git a/src/document/sync.rs b/src/document/sync.rs index 7695b82..c703300 100644 --- a/src/document/sync.rs +++ b/src/document/sync.rs @@ -870,6 +870,16 @@ impl SyncSession { self.reply_backoff.reset(); } + /// The peer answered our message with a delta offer (`SyncBody::Delta`): the wait + /// ends, and to Automerge no message of ours is in flight any more, as an answer of + /// its own would have told it. Else, with our heads unchanged (an offer we don't + /// fetch, or a download that fails), it would say nothing again, and the peer would + /// never hear what we have to offer afresh. + pub(crate) fn answered_by_offer(&mut self) { + self.reply_settled(); + self.state.in_flight = false; + } + /// If the answer is overdue: forgets that the unanswered changes were sent and that /// a message is in flight, so the next sync pass sends them again. Returns how many /// changes that concerns. -- cgit v1.3.1