From 3ad97fde0b88869d744569a38291521ddb5b1cf0 Mon Sep 17 00:00:00 2001 From: cloudhead Date: Mon, 27 Nov 2023 16:35:14 +0100 Subject: [PATCH] node: Small fix to sync-status We weren't correctly updating the sync status for the local node previously. --- radicle-node/src/service.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/radicle-node/src/service.rs b/radicle-node/src/service.rs index 78d5bb85..ef0f10da 100644 --- a/radicle-node/src/service.rs +++ b/radicle-node/src/service.rs @@ -490,16 +490,12 @@ where if updated_at.oid == announced.oid { continue; } - } else { - debug!(target: "service", "Saving local sync status for {rid}.."); - // If we don't have a sync status for this repo, create one. - self.addresses.synced( - &rid, - &nid, - updated_at.oid, - updated_at.timestamp.as_millis(), - )?; } + // Make sure our local node's sync status is up to date with storage. + debug!(target: "service", "Saving local sync status for {rid}.."); + self.addresses + .synced(&rid, &nid, updated_at.oid, updated_at.timestamp.as_millis())?; + // If we got here, it likely means a repo was updated while the node was stopped. // Therefore, we pre-load a refs announcement for this repo, so that it is included in // the historical gossip messages when a node connects and subscribes to this repo.