Skip to content

Commit

Permalink
fix: revert setImmediate trick
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Jul 14, 2023
1 parent 88e4b32 commit 77b8e7a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,7 @@ class MqttClient extends EventEmitter {
}
if (this.options.properties.authenticationMethod && this.options.authPacket && typeof this.options.authPacket === 'object') {
const authPacket = { cmd: 'auth', reasonCode: 0, ...this.options.authPacket }
// prevent race condition in tests
setImmediate(() => {
this._writePacket(authPacket)
})
this._writePacket(authPacket)
}
}

Expand Down

0 comments on commit 77b8e7a

Please sign in to comment.