Skip to content

Commit 757579d

Browse files
committed
fix(connection): only buffer for "open" events when calling connection helper while connecting
1 parent ff3d36f commit 757579d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/connection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ function _wrapConnHelper(fn) {
420420
Array.prototype.slice.call(arguments, 0, arguments.length - 1) :
421421
Array.prototype.slice.call(arguments);
422422
return utils.promiseOrCallback(cb, cb => {
423-
if (this.readyState !== STATES.connected) {
423+
if (this.readyState === STATES.connecting) {
424424
this.once('open', function() {
425425
fn.apply(this, argsWithoutCb.concat([cb]));
426426
});

0 commit comments

Comments
 (0)