From 76a5e7b46dbe90ebf5e31904cb510e6cab242cf4 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 26 Feb 2026 21:13:29 +0000 Subject: feat: track and display kind-5 deletion count in FetchReport Add a deletions counter to FetchReport, incremented in process_fetched_events for each kind-5 event received and accumulated across relays in consolidate_fetch_reports. The count is included in the fetch summary display (e.g. "1 deletion", "2 deletions"). --- src/lib/client.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/lib/client.rs b/src/lib/client.rs index 95dd78d..634dce2 100644 --- a/src/lib/client.rs +++ b/src/lib/client.rs @@ -1962,6 +1962,8 @@ async fn process_fetched_events( report.updated_state = Some((event.created_at, event.id)); } } + } else if event.kind.eq(&Kind::EventDeletion) { + report.deletions += 1; } else if event_is_patch_set_root(event) || event.kind.eq(&KIND_PULL_REQUEST) { fresh_proposal_roots.insert(event.id); report.proposals.insert(event.id); @@ -2064,6 +2066,7 @@ pub fn consolidate_fetch_reports(reports: Vec>) -> FetchRepo for c in relay_report.statuses { report.statuses.insert(c); } + report.deletions += relay_report.deletions; for c in relay_report.contributor_profiles { report.contributor_profiles.insert(c); } @@ -2234,6 +2237,8 @@ pub struct FetchReport { /// commits against existing propoals commits: HashSet, statuses: HashSet, + /// Count of kind-5 deletion events received (for display purposes). + deletions: u32, contributor_profiles: HashSet, profile_updates: HashSet, /// The best (newest) state event seen on each relay during the fetch. @@ -2295,6 +2300,13 @@ impl Display for FetchReport { if self.statuses.len() > 1 { "es" } else { "" }, )); } + if self.deletions > 0 { + display_items.push(format!( + "{} deletion{}", + self.deletions, + if self.deletions > 1 { "s" } else { "" }, + )); + } if !self.contributor_profiles.is_empty() { display_items.push(format!( "{} user profile{}", -- cgit v1.2.3