From 47dc2c562ca5f6566dd357094f275d7bbf014064 Mon Sep 17 00:00:00 2001 From: Fintan Halpenny Date: Wed, 17 Dec 2025 13:57:25 +0000 Subject: [PATCH] protocol/service: defensive storage.contains check In the case of the `storage.contains` call returning an error, it would be preferable to log the error and continue checking for missing repositories. --- crates/radicle-protocol/src/service.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/radicle-protocol/src/service.rs b/crates/radicle-protocol/src/service.rs index 775d692e..a437b4e9 100644 --- a/crates/radicle-protocol/src/service.rs +++ b/crates/radicle-protocol/src/service.rs @@ -2530,8 +2530,16 @@ where if !policy.is_allow() { continue; } - if self.storage.contains(&rid)? { - continue; + match self.storage.contains(&rid) { + Ok(exists) => { + if exists { + continue; + } + } + Err(err) => { + log::warn!(target: "protocol::filter", "Failed to check if {rid} exists: {err}"); + continue; + } } match self.seeds(&rid, [self.node_id()].into()) { Ok(seeds) => {