From a8bb4fb3c420077f8ab9118afb07ef5b126c2f0c Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 23 Jan 2026 11:09:08 +0000 Subject: [PATCH] fix(nip34): Use repository relays instead of AGGREGATOR_RELAYS Status events for issues are now fetched from the relays configured in the repository definition, not from hardcoded aggregator relays. This respects the relay hints provided by repository maintainers for better decentralization and reliability. https://claude.ai/code/session_01C6Lty4k9pKxdwnYUCcpzV2 --- src/components/nostr/kinds/IssueDetailRenderer.tsx | 10 ++++++++-- src/components/nostr/kinds/IssueRenderer.tsx | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/components/nostr/kinds/IssueDetailRenderer.tsx b/src/components/nostr/kinds/IssueDetailRenderer.tsx index 17b0382..ffa3a49 100644 --- a/src/components/nostr/kinds/IssueDetailRenderer.tsx +++ b/src/components/nostr/kinds/IssueDetailRenderer.tsx @@ -14,6 +14,7 @@ import { getIssueTitle, getIssueLabels, getIssueRepositoryAddress, + getRepositoryRelays, getStatusType, getValidStatusAuthors, findCurrentStatus, @@ -24,7 +25,6 @@ import { RepositoryLink } from "../RepositoryLink"; import { useTimeline } from "@/hooks/useTimeline"; import { useNostrEvent } from "@/hooks/useNostrEvent"; import { formatTimestamp } from "@/hooks/useLocale"; -import { AGGREGATOR_RELAYS } from "@/services/loaders"; /** * Get the icon for a status kind @@ -90,6 +90,12 @@ export function IssueDetailRenderer({ event }: { event: NostrEvent }) { const repositoryEvent = useNostrEvent(repoPointer); + // Get relays configured in the repository for fetching status events + const statusRelays = useMemo( + () => (repositoryEvent ? getRepositoryRelays(repositoryEvent) : []), + [repositoryEvent], + ); + // Fetch status events that reference this issue // Status events use e tag with root marker to reference the issue const statusFilter = useMemo( @@ -103,7 +109,7 @@ export function IssueDetailRenderer({ event }: { event: NostrEvent }) { const { events: statusEvents, loading: statusLoading } = useTimeline( `issue-status-${event.id}`, statusFilter, - AGGREGATOR_RELAYS, + statusRelays, { limit: 20 }, ); diff --git a/src/components/nostr/kinds/IssueRenderer.tsx b/src/components/nostr/kinds/IssueRenderer.tsx index e8d1acb..d39a82b 100644 --- a/src/components/nostr/kinds/IssueRenderer.tsx +++ b/src/components/nostr/kinds/IssueRenderer.tsx @@ -9,6 +9,7 @@ import { getIssueTitle, getIssueLabels, getIssueRepositoryAddress, + getRepositoryRelays, getStatusType, getValidStatusAuthors, findCurrentStatus, @@ -18,7 +19,6 @@ import { Label } from "@/components/ui/label"; import { RepositoryLink } from "../RepositoryLink"; import { useTimeline } from "@/hooks/useTimeline"; import { useNostrEvent } from "@/hooks/useNostrEvent"; -import { AGGREGATOR_RELAYS } from "@/services/loaders"; /** * Get the icon for a status kind @@ -84,6 +84,12 @@ export function IssueRenderer({ event }: BaseEventProps) { const repositoryEvent = useNostrEvent(repoPointer); + // Get relays configured in the repository for fetching status events + const statusRelays = useMemo( + () => (repositoryEvent ? getRepositoryRelays(repositoryEvent) : []), + [repositoryEvent], + ); + // Fetch status events that reference this issue const statusFilter = useMemo( () => ({ @@ -96,7 +102,7 @@ export function IssueRenderer({ event }: BaseEventProps) { const { events: statusEvents } = useTimeline( `issue-status-${event.id}`, statusFilter, - AGGREGATOR_RELAYS, + statusRelays, { limit: 10 }, );