Skip to content

Commit

Permalink
fix(connection): only buffer for "open" events when calling connectio…
Browse files Browse the repository at this point in the history
…n helper while connecting
  • Loading branch information
vkarpov15 committed Nov 19, 2019
1 parent ff3d36f commit 757579d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ function _wrapConnHelper(fn) {
Array.prototype.slice.call(arguments, 0, arguments.length - 1) :
Array.prototype.slice.call(arguments);
return utils.promiseOrCallback(cb, cb => {
if (this.readyState !== STATES.connected) {
if (this.readyState === STATES.connecting) {
this.once('open', function() {
fn.apply(this, argsWithoutCb.concat([cb]));
});
Expand Down

0 comments on commit 757579d

Please sign in to comment.