bkanber / Slackadaisical

Command line Slack chat client.
GNU General Public License v3.0
275 stars 13 forks source link

Double-clicking on channels almost always causes crash #15

Open tjcelaya opened 6 years ago

tjcelaya commented 6 years ago

As the title states, double-clicking on the general channel in the Slack I'm signed into causes the following crash:

TypeError: Cannot read property 'width' of null
    at Box.Element._getWidth (~/.nvm/versions/node/v8.3.0/lib/node_modules/slackadaisical/node_modules/blessed/lib/widgets/element.js:1060:19)
    at Box.width (~/.nvm/versions/node/v8.3.0/lib/node_modules/slackadaisical/node_modules/blessed/lib/widgets/element.js:1095:15)
    at MessagesList.render (~/.nvm/versions/node/v8.3.0/lib/node_modules/slackadaisical/dist/MessagesList.js:105:42)
    at MessagesList.loadHistory (~/.nvm/versions/node/v8.3.0/lib/node_modules/slackadaisical/dist/MessagesList.js:142:18)
    at ~/.nvm/versions/node/v8.3.0/lib/node_modules/slackadaisical/dist/MessagesList.js:87:23
    at Request._callback (~/.nvm/versions/node/v8.3.0/lib/node_modules/slackadaisical/dist/SlackAPI.js:166:53)
    at Request.self.callback (~/.nvm/versions/node/v8.3.0/lib/node_modules/slackadaisical/node_modules/request/request.js:185:22)
    at emitTwo (events.js:125:13)
    at Request.emit (events.js:213:7)
    at Request.<anonymous> (~/.nvm/versions/node/v8.3.0/lib/node_modules/slackadaisical/node_modules/request/request.js:1157:10)

It seems like double-clicking on a DM (or group DM) reliably causes a different stack trace:

TypeError: Cannot read property 'ts' of undefined
    at SlackAPI.markChannelRead (~/.nvm/versions/node/v8.3.0/lib/node_modules/slackadaisical/dist/SlackAPI.js:137:75)
    at MessagesList.loadHistory (~/.nvm/versions/node/v8.3.0/lib/node_modules/slackadaisical/dist/MessagesList.js:133:26)
    at ~/.nvm/versions/node/v8.3.0/lib/node_modules/slackadaisical/dist/MessagesList.js:87:23
    at Request._callback (~/.nvm/versions/node/v8.3.0/lib/node_modules/slackadaisical/dist/SlackAPI.js:166:53)
    at Request.self.callback (~/.nvm/versions/node/v8.3.0/lib/node_modules/slackadaisical/node_modules/request/request.js:185:22)
    at emitTwo (events.js:125:13)
    at Request.emit (events.js:213:7)
    at Request.<anonymous> (~/.nvm/versions/node/v8.3.0/lib/node_modules/slackadaisical/node_modules/request/request.js:1157:10)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)

Thankfully, selecting the channels with ctrl-L > enter so I've been using that as a workaround. I've also noticed that single-clicking on the channel, waiting for a small delay, and then clicking again sometimes avoids the crash but it's not very reliable.

ErikLentz commented 6 years ago

My workaround is to pause between clicks. So click the channel, wait a second, click again. It opens.