fix: 🐛

This commit is contained in:
codytseng
2025-11-19 09:57:57 +08:00
parent 25d8ad1532
commit c845a4fc4f

View File

@@ -384,7 +384,7 @@ class ClientService extends EventTarget {
// eslint-disable-next-line @typescript-eslint/no-this-alias // eslint-disable-next-line @typescript-eslint/no-this-alias
const that = this const that = this
const _knownIds = new Set<string>() const _knownIds = new Set<string>()
let startedCount = 0 let startedCount = relays.length
let eosedCount = 0 let eosedCount = 0
let eosed = false let eosed = false
let closedCount = 0 let closedCount = 0
@@ -396,7 +396,6 @@ class ClientService extends EventTarget {
subPromises.push(startSub()) subPromises.push(startSub())
async function startSub() { async function startSub() {
startedCount++
const relay = await that.pool.ensureRelay(url, { connectionTimeout: 5000 }).catch(() => { const relay = await that.pool.ensureRelay(url, { connectionTimeout: 5000 }).catch(() => {
return undefined return undefined
}) })
@@ -451,6 +450,7 @@ class ClientService extends EventTarget {
.then(() => { .then(() => {
hasAuthed = true hasAuthed = true
if (!eosed) { if (!eosed) {
startedCount++
subPromises.push(startSub()) subPromises.push(startSub())
} }
}) })
@@ -718,7 +718,7 @@ class ClientService extends EventTarget {
resolve(events) resolve(events)
} }
}, },
onclose: () => { onAllClose: () => {
resolve(events) resolve(events)
} }
}) })