|
|
|
@ -1079,25 +1079,23 @@ function ReplyNoteList({ |
|
|
|
}) |
|
|
|
}) |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// For URL threads: stream events as they arrive from each relay so replies appear
|
|
|
|
// Stream replies as relays return them (aggr is first in the list) instead of waiting for full EOSE.
|
|
|
|
// immediately, rather than waiting up to 10 s for all relays to EOSE.
|
|
|
|
const streamThreadReply = (evt: NEvent) => { |
|
|
|
const urlThreadRootInfo = rootInfo.type === 'I' ? rootInfo : null |
|
|
|
if (fetchGeneration !== replyFetchGenRef.current) return |
|
|
|
const urlThreadOnevent = urlThreadRootInfo |
|
|
|
if (isPollVoteKind(evt)) return |
|
|
|
? (evt: NEvent) => { |
|
|
|
if (rootInfo.type === 'I') { |
|
|
|
if (fetchGeneration !== replyFetchGenRef.current) return |
|
|
|
if (!isRssArticleUrlThreadInteraction(evt, rootInfo.id)) return |
|
|
|
if (isPollVoteKind(evt)) return |
|
|
|
} |
|
|
|
if (!isRssArticleUrlThreadInteraction(evt, urlThreadRootInfo.id)) return |
|
|
|
if (shouldHideThreadResponseEvent(evt, mutePubkeySet, hideContentMentioningMutedUsers)) return |
|
|
|
if (shouldHideThreadResponseEvent(evt, mutePubkeySet, hideContentMentioningMutedUsers)) |
|
|
|
addReplies([evt]) |
|
|
|
return |
|
|
|
if (!hasCache) setLoading(false) |
|
|
|
addReplies([evt]) |
|
|
|
} |
|
|
|
if (!hasCache) setLoading(false) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
: undefined |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Use fetchEvents instead of subscribeTimeline for one-time fetching
|
|
|
|
|
|
|
|
const allReplies = await queryService.fetchEvents(relayUrlsForThreadReq, filters, { |
|
|
|
const allReplies = await queryService.fetchEvents(relayUrlsForThreadReq, filters, { |
|
|
|
...(urlThreadOnevent ? { onevent: urlThreadOnevent } : {}), |
|
|
|
onevent: streamThreadReply, |
|
|
|
foreground: statsForeground, |
|
|
|
foreground: true, |
|
|
|
|
|
|
|
firstRelayResultGraceMs: 900, |
|
|
|
|
|
|
|
globalTimeout: 12_000, |
|
|
|
relayOpSource: 'ReplyNoteList.thread' |
|
|
|
relayOpSource: 'ReplyNoteList.thread' |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
@ -1112,7 +1110,6 @@ function ReplyNoteList({ |
|
|
|
// Filter and add replies (URL threads include kind 9802 highlights of this page)
|
|
|
|
// Filter and add replies (URL threads include kind 9802 highlights of this page)
|
|
|
|
const regularReplies = allReplies.filter((evt) => { |
|
|
|
const regularReplies = allReplies.filter((evt) => { |
|
|
|
if (isPollVoteKind(evt)) return false |
|
|
|
if (isPollVoteKind(evt)) return false |
|
|
|
false |
|
|
|
|
|
|
|
const match = replyMatchesThreadForList(evt, event, rootInfo, isDiscussionRoot, threadWalkFromBatch) |
|
|
|
const match = replyMatchesThreadForList(evt, event, rootInfo, isDiscussionRoot, threadWalkFromBatch) |
|
|
|
if (!match) return false |
|
|
|
if (!match) return false |
|
|
|
return !shouldHideThreadResponseEvent( |
|
|
|
return !shouldHideThreadResponseEvent( |
|
|
|
|