From c15288a690416765c868f74cbf3dc4c7fe0b03fe Mon Sep 17 00:00:00 2001 From: Fintan Halpenny Date: Wed, 6 Aug 2025 12:32:15 +0100 Subject: [PATCH] radicle: note about Announcer::can_continue Making a note of that `Announcer::can_continue` might never be able to hit the `Break` case. It could be defensive programming, so I'm going to leave it in for the time being. --- crates/radicle/src/node/sync/announce.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/radicle/src/node/sync/announce.rs b/crates/radicle/src/node/sync/announce.rs index 701dbb72..8e5c95d6 100644 --- a/crates/radicle/src/node/sync/announce.rs +++ b/crates/radicle/src/node/sync/announce.rs @@ -135,6 +135,11 @@ impl Announcer { /// If there are no more nodes, then [`NoNodes`] is returned in the /// [`ControlFlow::Break`], otherwise the [`Announcer`] is returned as-is in /// the [`ControlFlow::Continue`]. + // TODO(finto): I'm not sure this is needed with the change to the target + // logic. Since we can reach the replication factor OR the preferred seeds, + // AND the replication factor is always capped to the maximum number of + // seeds to sync with, I don't think we can ever reach a case where + // `can_continue` hits the `Break`. pub fn can_continue(self) -> ControlFlow { if self.to_sync.is_empty() { ControlFlow::Break(NoNodes {