fix "<forced-ping>" mismatch.

fixes https://github.com/nbd-wtf/nostr-tools/issues/539
This commit is contained in:
fiatjaf
2026-07-29 16:43:49 -03:00
parent 5609bab1ac
commit 7fa1ef45c5
+6 -4
View File
@@ -670,10 +670,12 @@ export class Subscription {
this.relay.openSubs.delete(this.id)
// compute idleness state
this.relay.ongoingOperations--
if (this.relay.ongoingOperations === 0) {
this.relay.idleSince = Date.now()
this.relay.scheduleIdleClose()
if (!this.id.startsWith('<forced-ping>')) {
this.relay.ongoingOperations--
if (this.relay.ongoingOperations === 0) {
this.relay.idleSince = Date.now()
this.relay.scheduleIdleClose()
}
}
this.onclose?.(reason)