upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/lib/client.rs12
2 files changed, 13 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1c5b583..5f88b1d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
12- git server push option passthrough, enabling `-o secret-scanning.skip` for grasp servers 12- git server push option passthrough, enabling `-o secret-scanning.skip` for grasp servers
13- `ngit sync` now publishes the current state event to grasp server relays that are missing it or have a stale version before attempting git pushes, preventing rejections; per-relay state visibility is captured during the nostr fetch and surfaced via `FetchReport::state_per_relay` 13- `ngit sync` now publishes the current state event to grasp server relays that are missing it or have a stale version before attempting git pushes, preventing rejections; per-relay state visibility is captured during the nostr fetch and surfaced via `FetchReport::state_per_relay`
14- Fetch filters now request kind-5 deletion events for cached state and repo announcement events by `#e` tag (NIP-09), in addition to the existing `#a`-tagged filter; ensures deletions of these events are received even from clients that do not embed a repo coordinate in their deletion event 14- Fetch filters now request kind-5 deletion events for cached state and repo announcement events by `#e` tag (NIP-09), in addition to the existing `#a`-tagged filter; ensures deletions of these events are received even from clients that do not embed a repo coordinate in their deletion event
15- `FetchReport` now tracks and displays a count of kind-5 deletion events received (e.g. `"1 deletion"` in the fetch summary)
15 16
16### Fixed 17### Fixed
17 18
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(
1962 report.updated_state = Some((event.created_at, event.id)); 1962 report.updated_state = Some((event.created_at, event.id));
1963 } 1963 }
1964 } 1964 }
1965 } else if event.kind.eq(&Kind::EventDeletion) {
1966 report.deletions += 1;
1965 } else if event_is_patch_set_root(event) || event.kind.eq(&KIND_PULL_REQUEST) { 1967 } else if event_is_patch_set_root(event) || event.kind.eq(&KIND_PULL_REQUEST) {
1966 fresh_proposal_roots.insert(event.id); 1968 fresh_proposal_roots.insert(event.id);
1967 report.proposals.insert(event.id); 1969 report.proposals.insert(event.id);
@@ -2064,6 +2066,7 @@ pub fn consolidate_fetch_reports(reports: Vec<Result<FetchReport>>) -> FetchRepo
2064 for c in relay_report.statuses { 2066 for c in relay_report.statuses {
2065 report.statuses.insert(c); 2067 report.statuses.insert(c);
2066 } 2068 }
2069 report.deletions += relay_report.deletions;
2067 for c in relay_report.contributor_profiles { 2070 for c in relay_report.contributor_profiles {
2068 report.contributor_profiles.insert(c); 2071 report.contributor_profiles.insert(c);
2069 } 2072 }
@@ -2234,6 +2237,8 @@ pub struct FetchReport {
2234 /// commits against existing propoals 2237 /// commits against existing propoals
2235 commits: HashSet<EventId>, 2238 commits: HashSet<EventId>,
2236 statuses: HashSet<EventId>, 2239 statuses: HashSet<EventId>,
2240 /// Count of kind-5 deletion events received (for display purposes).
2241 deletions: u32,
2237 contributor_profiles: HashSet<PublicKey>, 2242 contributor_profiles: HashSet<PublicKey>,
2238 profile_updates: HashSet<PublicKey>, 2243 profile_updates: HashSet<PublicKey>,
2239 /// The best (newest) state event seen on each relay during the fetch. 2244 /// The best (newest) state event seen on each relay during the fetch.
@@ -2295,6 +2300,13 @@ impl Display for FetchReport {
2295 if self.statuses.len() > 1 { "es" } else { "" }, 2300 if self.statuses.len() > 1 { "es" } else { "" },
2296 )); 2301 ));
2297 } 2302 }
2303 if self.deletions > 0 {
2304 display_items.push(format!(
2305 "{} deletion{}",
2306 self.deletions,
2307 if self.deletions > 1 { "s" } else { "" },
2308 ));
2309 }
2298 if !self.contributor_profiles.is_empty() { 2310 if !self.contributor_profiles.is_empty() {
2299 display_items.push(format!( 2311 display_items.push(format!(
2300 "{} user profile{}", 2312 "{} user profile{}",