Skip to content

Commit c1f7d2a

Browse files
authored
fix: don't call onConnect automatically (#3407)
In some edge cases this causes issues. Leave it to the user to handle if necessary.
1 parent d61af69 commit c1f7d2a

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

lib/handler/decorator-handler.js

-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
'use strict'
22

33
const assert = require('node:assert')
4-
const noop = () => {}
54

65
module.exports = class DecoratorHandler {
76
#handler
8-
#onConnectCalled = false
97
#onCompleteCalled = false
108
#onErrorCalled = false
119

@@ -17,16 +15,10 @@ module.exports = class DecoratorHandler {
1715
}
1816

1917
onConnect (...args) {
20-
this.#onConnectCalled = true
2118
return this.#handler.onConnect?.(...args)
2219
}
2320

2421
onError (...args) {
25-
if (!this.#onConnectCalled) {
26-
this.#onConnectCalled = true
27-
this.#handler.onConnect?.(noop)
28-
}
29-
3022
this.#onErrorCalled = true
3123
return this.#handler.onError?.(...args)
3224
}

0 commit comments

Comments
 (0)