From 726a5bf7c476b6a2878b660018f33f0f801d9f93 Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Sat, 24 Feb 2018 19:51:16 -0800 Subject: [PATCH] Minor tweaks to specific error conditions --- src/channel/channel.js | 7 +++++-- src/user.js | 16 +++++----------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/channel/channel.js b/src/channel/channel.js index 6e3b7cf3..c8e8b999 100644 --- a/src/channel/channel.js +++ b/src/channel/channel.js @@ -320,9 +320,12 @@ Channel.prototype.checkModules = function (fn, args, cb) { if (!self.modules) { LOGGER.warn( - 'checkModules(%s): self.modules is undefined; dead=%s', + 'checkModules(%s): self.modules is undefined; dead=%s,' + + ' current=%s, remaining=%s', fn, - self.dead + self.dead, + m, + keys ); return; } diff --git a/src/user.js b/src/user.js index e43c1c79..ee504c69 100644 --- a/src/user.js +++ b/src/user.js @@ -243,17 +243,11 @@ User.prototype.setAFK = function (afk) { } if (!this.inChannel()) { - // I haven't exactly nailed down why this.channel can - // become null halfway through the function, but based - // on log analysis I suspect it's because this.socket.emit() - // can fire the "disconnect" event which then tears down - // the User object. - LOGGER.warn( - "Encountered this.channel == null from setAFK. " + - "this.dead=%t this.flags=%b", - this.dead, - this.flags - ); + /* + * In unusual circumstances, the above emit("clearVoteskipVote") + * can cause the "disconnect" event to be fired synchronously, + * which results in this user no longer being in the channel. + */ return; }