diff --git a/src/lib/stores/Issue.ts b/src/lib/stores/Issue.ts index bf7902b..b18854f 100644 --- a/src/lib/stores/Issue.ts +++ b/src/lib/stores/Issue.ts @@ -70,10 +70,10 @@ export const ensureIssueFull = (repo_identifier: string, issue_id: string) => { sub = ndk.subscribe( { ids: [issue_id], - limit: 50, + limit: 100, }, { - closeOnEose: true, + closeOnEose: false, }, NDKRelaySet.fromRelayUrls(relays_to_use, ndk) ) diff --git a/src/lib/stores/Issues.ts b/src/lib/stores/Issues.ts index c666d8e..27f03a8 100644 --- a/src/lib/stores/Issues.ts +++ b/src/lib/stores/Issues.ts @@ -64,7 +64,7 @@ export const ensureIssueSummaries = async (repo_id: string | undefined) => { let relays_to_use = [...base_relays] let filter: NDKFilter = { kinds: [issue_kind], - limit: 50, + limit: 100, } if (repo_id) { @@ -86,14 +86,14 @@ export const ensureIssueSummaries = async (repo_id: string | undefined) => { '#a': repo.maintainers.map( (m) => `${repo_kind}:${m.hexpubkey}:${repo.identifier}` ), - limit: 50, + limit: 100, } } sub = ndk.subscribe( filter, { - closeOnEose: true, + closeOnEose: false, }, NDKRelaySet.fromRelayUrls(relays_to_use, ndk) ) @@ -170,7 +170,7 @@ function getAndUpdateIssueStatus( '#e': issues.summaries.map((issue) => issue.id), }, { - closeOnEose: true, + closeOnEose: false, }, NDKRelaySet.fromRelayUrls(relays, ndk) ) diff --git a/src/lib/stores/Proposal.ts b/src/lib/stores/Proposal.ts index afaf8c7..5cb1b31 100644 --- a/src/lib/stores/Proposal.ts +++ b/src/lib/stores/Proposal.ts @@ -30,6 +30,8 @@ let sub: NDKSubscription let sub_replies: NDKSubscription +const sub_revisions: NDKSubscription[] = [] + let revision_ids_queried: string[] export const ensureProposalFull = ( @@ -45,6 +47,7 @@ export const ensureProposalFull = ( if (sub) sub.stop() if (sub_replies) sub_replies.stop() + sub_revisions.forEach((sub) => sub.stop()) selected_proposal_repo_id = repo_identifier selected_proposal_id = proposal_id @@ -76,10 +79,10 @@ export const ensureProposalFull = ( sub = ndk.subscribe( { ids: [proposal_id], - limit: 50, + limit: 100, }, { - closeOnEose: true, + closeOnEose: false, }, NDKRelaySet.fromRelayUrls(relays_to_use, ndk) ) @@ -193,16 +196,17 @@ export const ensureProposalFull = ( const sub_revision_replies = ndk.subscribe( { '#e': [event.id], - limit: 50, + limit: 100, }, { - closeOnEose: true, + closeOnEose: false, }, NDKRelaySet.fromRelayUrls(relays_to_use, ndk) ) sub_revision_replies.on('event', (event: NDKEvent) => { process_replies(event) }) + sub_revisions.push(sub_revision_replies) } } diff --git a/src/lib/stores/Proposals.ts b/src/lib/stores/Proposals.ts index 55f393e..e772d37 100644 --- a/src/lib/stores/Proposals.ts +++ b/src/lib/stores/Proposals.ts @@ -59,7 +59,7 @@ export const ensureProposalSummaries = async (repo_id: string | undefined) => { let relays_to_use = [...base_relays] let filter: NDKFilter = { kinds: [patch_kind], - limit: 50, + limit: 100, } if (repo_id) { @@ -84,7 +84,7 @@ export const ensureProposalSummaries = async (repo_id: string | undefined) => { '#a': repo.maintainers.map( (m) => `${repo_kind}:${m.hexpubkey}:${repo.identifier}` ), - limit: 50, + limit: 100, } } else { filter = { @@ -93,7 +93,7 @@ export const ensureProposalSummaries = async (repo_id: string | undefined) => { (m) => `${repo_kind}:${m.hexpubkey}:${repo.identifier}` ), '#t': ['root'], - limit: 50, + limit: 100, } } } @@ -101,7 +101,7 @@ export const ensureProposalSummaries = async (repo_id: string | undefined) => { sub = ndk.subscribe( filter, { - closeOnEose: true, + closeOnEose: false, }, NDKRelaySet.fromRelayUrls(relays_to_use, ndk) ) @@ -187,7 +187,7 @@ function getAndUpdateProposalStatus( '#e': proposals.summaries.map((proposal) => proposal.id), }, { - closeOnEose: true, + closeOnEose: false, }, NDKRelaySet.fromRelayUrls(relays, ndk) )