fix removing error listeners

This commit is contained in:
liamcottle 2025-08-29 21:16:02 +12:00
parent 536e7641e0
commit 352333153c

View file

@ -1428,7 +1428,7 @@ class Connection extends EventEmitter {
const onSent = (response) => {
// remove error listener since we received sent response
this.once(Constants.ResponseCodes.Err, onErr);
this.off(Constants.ResponseCodes.Err, onErr);
// reject login request as timed out after estimated delay, plus a bit extra
const estTimeout = response.estTimeout + extraTimeoutMillis;
@ -1491,7 +1491,7 @@ class Connection extends EventEmitter {
const onSent = (response) => {
// remove error listener since we received sent response
this.once(Constants.ResponseCodes.Err, onErr);
this.off(Constants.ResponseCodes.Err, onErr);
// reject login request as timed out after estimated delay, plus a bit extra
const estTimeout = response.estTimeout + extraTimeoutMillis;
@ -1576,7 +1576,7 @@ class Connection extends EventEmitter {
const onSent = (response) => {
// remove error listener since we received sent response
this.once(Constants.ResponseCodes.Err, onErr);
this.off(Constants.ResponseCodes.Err, onErr);
// reject as timed out after estimated delay, plus a bit extra
const estTimeout = response.estTimeout + extraTimeoutMillis;