From 2311d0cc57a2e0d5776b355983ca2e3f82f9980f Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 23 Oct 2026 21:25:34 +0200 Subject: use only ready peers as sync source Sync messages now carries a ready flag, telling whether the sending peer itself is joined or is itself still (re-)joining. In the latter case, the peer won't be used as sync source. --- src/state.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/state.rs') diff --git a/src/state.rs b/src/state.rs index 4fbc05b..23892a9 100644 --- a/src/state.rs +++ b/src/state.rs @@ -120,6 +120,9 @@ pub(crate) struct PeerState { /// Epoch the peer advertised in its most recent message. pub(crate) epoch: Option, + + /// Whether the peer was ready according to its most recent sync message. + pub(crate) reports_ready: Option, } /// One Automerge sync with a peer, from a reset to the next. Everything a reset must @@ -322,6 +325,7 @@ impl PeerState { last_sync_rx: None, last_resync_at: None, epoch: None, + reports_ready: None, } } -- cgit v1.3.1