fix: Client retry logic, redundant listener set (#233)

This commit is contained in:
MirzaSamadAhmedBaig
2025-06-28 12:14:21 +08:00
committed by GitHub
parent 4c05962f26
commit 7f33a7aca7
+1 -2
View File
@@ -56,7 +56,7 @@ export class Client<C = undefined> {
catch (err) {
console.error('Encountered an error when retrying', err)
await sleep(2 ** attempts * 1000)
await this.retryWithExponentialBackoff(fn, attempts++, maxAttempts)
await this.retryWithExponentialBackoff(fn, attempts + 1, maxAttempts)
}
}
@@ -190,7 +190,6 @@ export class Client<C = undefined> {
}
listeners.push(callback as unknown as (data: WebSocketBaseEvent<E, WebSocketEvents<C>[E]>) => void | Promise<void>)
this.eventListeners.set(event, listeners)
}
send(data: WebSocketEvent<C>): void {