Fix subscribeMap EOSE grouping. Fixes #514

This commit is contained in:
Chris McCormick
2025-10-29 14:28:11 +08:00
committed by fiatjaf
parent 1bec9fa365
commit 1e0f393268
3 changed files with 4 additions and 4 deletions

View File

@@ -136,7 +136,7 @@ export class AbstractSimplePool {
let handleEose = (i: number) => { let handleEose = (i: number) => {
if (eosesReceived[i]) return // do not act twice for the same relay if (eosesReceived[i]) return // do not act twice for the same relay
eosesReceived[i] = true eosesReceived[i] = true
if (eosesReceived.filter(a => a).length === requests.length) { if (eosesReceived.filter(a => a).length === groupedRequests.length) {
params.oneose?.() params.oneose?.()
handleEose = () => {} handleEose = () => {}
} }
@@ -147,7 +147,7 @@ export class AbstractSimplePool {
if (closesReceived[i]) return // do not act twice for the same relay if (closesReceived[i]) return // do not act twice for the same relay
handleEose(i) handleEose(i)
closesReceived[i] = reason closesReceived[i] = reason
if (closesReceived.filter(a => a).length === requests.length) { if (closesReceived.filter(a => a).length === groupedRequests.length) {
params.onclose?.(closesReceived) params.onclose?.(closesReceived)
handleClose = () => {} handleClose = () => {}
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "@nostr/tools", "name": "@nostr/tools",
"version": "2.17.1", "version": "2.17.2",
"exports": { "exports": {
".": "./index.ts", ".": "./index.ts",
"./core": "./core.ts", "./core": "./core.ts",

View File

@@ -1,7 +1,7 @@
{ {
"type": "module", "type": "module",
"name": "nostr-tools", "name": "nostr-tools",
"version": "2.17.1", "version": "2.17.2",
"description": "Tools for making a Nostr client.", "description": "Tools for making a Nostr client.",
"repository": { "repository": {
"type": "git", "type": "git",