From 800ef4faf27abebbce8a553763d6e60662fde997 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 8 Nov 2026 09:49:26 +0000 Subject: sync: a member refused as a whole, synced with again once it changed document A node refusing a member as a whole sent it nothing, and lifted that only when a change of the member's was taken again. But a member that dropped what was refused (REFUSALS) starts its sync sessions over, and a fresh session sends no changes until the other side answers: the two waited for each other, and the member stayed refused. The refusal now notes the member's run and epoch_seq when it began; a member with another document since (it dropped what was refused, or rejoined) is synced with again. --- src/state/peer.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/state/peer.rs') diff --git a/src/state/peer.rs b/src/state/peer.rs index e0b161d..f6e4a62 100644 --- a/src/state/peer.rs +++ b/src/state/peer.rs @@ -141,6 +141,10 @@ pub(crate) struct PeerState { pub(crate) epoch_seq: Option, /// The peer's run, from its HELLO or HELLO_REPLY: a new one starts `epoch_seq` over. pub(crate) run_id: Option, + /// While we refuse the peer as a whole (`access::screen`): its run and `epoch_seq` + /// when we began to. Another means it has another document since (it dropped what + /// we refused, `swarm::refusals`, or rejoined): we sync with it again. + pub(crate) refused_with: Option<(Option, Option)>, /// The newest handshake the peer started with us: its run and number /// (`HelloRequest::handshake`). A HELLO repeating it is a retry or a late copy. pub(crate) last_hello: Option<(crate::transport::RunId, u32)>, @@ -319,6 +323,7 @@ impl PeerState { epoch: None, epoch_seq: None, run_id: None, + refused_with: None, last_hello: None, handshake: 0, reports_ready: None, -- cgit v1.3.1