mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-06 07:28:23 +00:00
fix: return error when negentropy has failures to enable REQ fallback
When negentropy sync times out or has other failures, it now properly returns Err() instead of Ok() with empty reconciliation. This ensures historic_sync increments failed_count and triggers fallback to REQ+EOSE instead of treating it as a successful sync with 0 events. Resolves issue where bootstrap relay timeouts were marked as complete instead of falling back to traditional sync.
This commit is contained in:
@@ -527,11 +527,19 @@ impl RelayConnection {
|
||||
self.nip77_supported
|
||||
.store(2, std::sync::atomic::Ordering::Relaxed);
|
||||
|
||||
tracing::debug!(
|
||||
relay = %self.url,
|
||||
failures = ?output.failed,
|
||||
"Negentropy diff had failures (timeout usually means relay doesn't support NIP-77)"
|
||||
);
|
||||
// Log warning only once per relay to avoid spam
|
||||
if !self
|
||||
.nip77_warning_logged
|
||||
.swap(true, std::sync::atomic::Ordering::Relaxed)
|
||||
{
|
||||
tracing::warn!(
|
||||
relay = %self.url,
|
||||
failures = ?output.failed,
|
||||
"Negentropy diff had failures (timeout usually means relay doesn't support NIP-77), will fall back to REQ+EOSE"
|
||||
);
|
||||
}
|
||||
|
||||
return Err(format!("Negentropy diff had failures: {:?}", output.failed));
|
||||
}
|
||||
|
||||
Ok(reconciliation)
|
||||
|
||||
Reference in New Issue
Block a user