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
This commit is contained in:
Claude
2026-01-23 11:09:08 +00:00
parent 82d3a20d19
commit a8bb4fb3c4
2 changed files with 16 additions and 4 deletions

View File

@@ -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 },
);

View File

@@ -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 },
);