From 9b49056a1464829652a0db4566ee3e7bd640681d Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 12 Aug 2026 15:35:36 +0000 Subject: [PATCH] fix(sync): schedule auxiliary coverage for full repositories Priority demotion moved q-tagged and other non-essential repository references out of core live filters, but descendant maintenance selected only relays that already had root events. A full repository with no accepted roots therefore never installed its auxiliary repository coverage, breaking bounded-REQ and adaptive regrouping delivery. Include relays with full repositories in the bounded maintenance frontier. Update the constrained-REQ regression to wait for the observable auxiliary generation before using a q-tagged event as its live-delivery probe. State-only repositories remain excluded, and maintenance still advances only one selected relay per tick. Validated with the bounded-REQ and filter-count-refusal integration tests. --- src/sync/mod.rs | 2 +- tests/sync/live_sync.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sync/mod.rs b/src/sync/mod.rs index e3b990b..8736006 100644 --- a/src/sync/mod.rs +++ b/src/sync/mod.rs @@ -4450,7 +4450,7 @@ impl SyncManager { let mut relay_urls: Vec = targets .iter() .filter(|(relay_url, needs)| { - !needs.root_events.is_empty() + (!needs.repos.is_empty() || !needs.root_events.is_empty()) && states.get(*relay_url).is_some_and(|state| { matches!( state.connection_status, diff --git a/tests/sync/live_sync.rs b/tests/sync/live_sync.rs index 03bebf5..df0bbee 100644 --- a/tests/sync/live_sync.rs +++ b/tests/sync/live_sync.rs @@ -150,6 +150,7 @@ async fn test_live_sync_batches_repo_filters_below_source_req_limit() { wait_for_sync_connection(syncing.url(), 1, Duration::from_secs(5)) .await .expect("syncing relay should connect to constrained source"); + wait_for_new_descendant_live_generation(&syncing, 0, Duration::from_secs(20)).await; // Observe one q-tagged event completing the round trip before testing a // second live event. This proves the relevant subscription is installed