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

View File

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

View File

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