upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/sync/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/sync/mod.rs')
-rw-r--r--src/sync/mod.rs22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/sync/mod.rs b/src/sync/mod.rs
index c78c0e1..16c8924 100644
--- a/src/sync/mod.rs
+++ b/src/sync/mod.rs
@@ -537,7 +537,18 @@ impl SyncManager {
537 } 537 }
538 } 538 }
539 539
540 // Recompute actions - will discover all repos/events again 540 // Re-subscribe to Layer 1 (announcements) without since filter for full discovery
541 // This is a fresh sync, so we want all announcements
542 let layer1_filter = filters::build_announcement_filter(None);
543 if let Err(e) = connection.subscribe_filter(layer1_filter).await {
544 tracing::error!(
545 relay = %relay_url,
546 error = %e,
547 "Failed to re-subscribe to Layer 1 during daily sync"
548 );
549 }
550
551 // Recompute actions for Layer 2+3 - will discover all repos/events again
541 self.recompute_actions_for_relay(relay_url).await; 552 self.recompute_actions_for_relay(relay_url).await;
542 553
543 if let Some(ref metrics) = self.metrics { 554 if let Some(ref metrics) = self.metrics {
@@ -887,11 +898,12 @@ impl SyncManager {
887 tracing::info!( 898 tracing::info!(
888 relay = %relay_url, 899 relay = %relay_url,
889 is_bootstrap = is_bootstrap, 900 is_bootstrap = is_bootstrap,
890 "Fresh sync - subscribing to Layer 1 without since filter" 901 "Fresh sync - Layer 1 already subscribed, recomputing Layer 2+3"
891 ); 902 );
892 // Fresh sync: Layer 1 without since 903 // Fresh sync: Layer 1 subscription (without since) was already established
893 // Layer 1 subscription is handled by the connection establishment 904 // during connect_and_subscribe() in handle_add_filters(). That call subscribes
894 // Just recompute actions for new items 905 // to kinds 30617+30618 for the full history. Here we only need to recompute
906 // Layer 2+3 actions based on the repos we're tracking.
895 self.recompute_actions_for_relay(relay_url).await; 907 self.recompute_actions_for_relay(relay_url).await;
896 } else { 908 } else {
897 // Quick reconnect: use since filter 909 // Quick reconnect: use since filter