mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-08 16:28:49 +00:00
Fix subscribeMap EOSE grouping. Fixes #514
This commit is contained in:
@@ -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 = () => {}
|
||||||
}
|
}
|
||||||
|
|||||||
2
jsr.json
2
jsr.json
@@ -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",
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user