diff --git a/src/components/NoteList/index.tsx b/src/components/NoteList/index.tsx
index 63bd515c..026a34c9 100644
--- a/src/components/NoteList/index.tsx
+++ b/src/components/NoteList/index.tsx
@@ -2054,8 +2054,15 @@ const NoteList = forwardRef(
if (oneShotFetch || mappedSubRequests.length === 0) return
if (isSpellPageLocalWarmup) return
const diskReq = mappedSubRequests as Array<{ urls: string[]; filter: TSubRequestFilter }>
+ const strictSingleRelayShard =
+ mappedSubRequests.length === 1 &&
+ mappedSubRequests[0]!.urls.length === 1 &&
+ (hostPrimaryPageNameRef.current === 'relay' ||
+ (allowKindlessRelayExploreRef.current && useFilterAsIsRef.current))
void client
- .getLocalFeedEvents(diskReq)
+ .getLocalFeedEvents(diskReq, {
+ strictRelayShardSourcesOnly: strictSingleRelayShard
+ })
.then((diskRaw) => {
if (!effectActive || timelineEffectStale()) return
const diskNarrowed = narrowLiveBatch(diskRaw)
@@ -2429,8 +2436,15 @@ const NoteList = forwardRef(
urls: string[]
filter: TSubRequestFilter
}>
+ const strictSingleRelayShardOneShot =
+ mappedSubRequests.length === 1 &&
+ mappedSubRequests[0]!.urls.length === 1 &&
+ (hostPrimaryPageNameRef.current === 'relay' ||
+ (allowKindlessRelayExploreRef.current && useFilterAsIsRef.current))
void client
- .getLocalFeedEvents(diskReqOneShot)
+ .getLocalFeedEvents(diskReqOneShot, {
+ strictRelayShardSourcesOnly: strictSingleRelayShardOneShot
+ })
.then((diskRaw) => {
if (!effectActive || timelineEffectStale()) return
if (diskRaw.length === 0) return
diff --git a/src/components/Relay/index.tsx b/src/components/Relay/index.tsx
index ef53220d..79c96541 100644
--- a/src/components/Relay/index.tsx
+++ b/src/components/Relay/index.tsx
@@ -7,8 +7,10 @@ import type { TPrimaryPageName } from '@/PageManager'
import { SINGLE_RELAY_KINDLESS_REQ_LIMIT } from '@/constants'
import { normalizeAnyRelayUrl } from '@/lib/url'
import { useCurrentRelays } from '@/providers/CurrentRelaysProvider'
+import client from '@/services/client.service'
import type { TFeedSubRequest } from '@/types'
-import { forwardRef, useEffect, useMemo, useRef, useState } from 'react'
+import type { Event } from 'nostr-tools'
+import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import NotFound from '../NotFound'
@@ -77,6 +79,21 @@ const Relay = forwardRef<
]
}, [normalizedUrl, debouncedInput])
+ /** When we know delivery relays, drop rows that never arrived from this feed’s relay (stale cache / mis-tagged). */
+ const relaySeenMatchKey = useMemo(
+ () => (normalizedUrl ? (normalizeAnyRelayUrl(normalizedUrl) || normalizedUrl).toLowerCase() : ''),
+ [normalizedUrl]
+ )
+ const shouldHideEventNotFromThisRelay = useCallback(
+ (ev: Event) => {
+ if (!relaySeenMatchKey) return false
+ const seen = client.getSeenEventRelayUrls(ev.id)
+ if (seen.length === 0) return false
+ return !seen.some((u) => (normalizeAnyRelayUrl(u) || u).toLowerCase() === relaySeenMatchKey)
+ },
+ [relaySeenMatchKey]
+ )
+
if (!normalizedUrl) {
return