From 563a93a505d1588cf4c9911510107988135db62e Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 9 Jan 2026 08:08:36 +0000 Subject: fix: MockSyncContext creates single clone tag with multiple values The mock was creating multiple clone tags (one per URL), which violated NIP-34 format and triggered validation errors added in commit 92bfbd3. NIP-34 specifies: single clone tag with multiple values ["clone", "https://url1.com", "https://url2.com", ...] NOT multiple clone tags: ["clone", "https://url1.com"] ["clone", "https://url2.com"] This regression caused 7 purgatory::sync::functions tests to fail because RepositoryAnnouncement::from_event() now correctly rejects announcements with multiple clone tags. Fixes: - next_url_skips_throttled_domains - next_url_skips_tried_urls - next_url_filters_our_domain - next_url_with_specific_domain - get_throttled_domains_returns_only_throttled_with_untried - sync_identifier_enqueues_throttled_domains_when_incomplete - sync_identifier_tries_multiple_urls_until_complete All 232 unit tests now pass. --- src/purgatory/sync/context.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/purgatory/sync/context.rs b/src/purgatory/sync/context.rs index 9e195c7..1c2d7f2 100644 --- a/src/purgatory/sync/context.rs +++ b/src/purgatory/sync/context.rs @@ -647,12 +647,12 @@ pub mod mock { vec!["test-repo".to_string()], )]; - for url in &self.clone_urls { - tags.push(nostr_sdk::Tag::custom( - nostr_sdk::TagKind::Custom("clone".into()), - vec![url.clone()], - )); - } + // Create a single clone tag with multiple values (NIP-34 format) + let clone_values: Vec = self.clone_urls.iter().cloned().collect(); + tags.push(nostr_sdk::Tag::custom( + nostr_sdk::TagKind::Custom("clone".into()), + clone_values, + )); let event = EventBuilder::new(Kind::from(30617), "") .tags(tags) -- cgit v1.2.3