notwaldorf / tiny-care-terminal

💖💻 A little dashboard that tries to take care of you when you're using your terminal.
MIT License
5.96k stars 243 forks source link

tiny-care-terminal crashing out after a period of time #101

Closed liamjones closed 6 years ago

liamjones commented 7 years ago

tiny-care-terminal is starting up but while left open in the background I sometimes find it crashing out with the following stack trace:

TypeError: Cannot read property 'text' of undefined
    at /home/liam/.nvm/versions/node/v6.10.1/lib/node_modules/tiny-care-terminal/twitterbot.js:27:30
    at /home/liam/.nvm/versions/node/v6.10.1/lib/node_modules/tiny-care-terminal/node_modules/twit/lib/twitter.js:118:13
    at onRequestComplete (/home/liam/.nvm/versions/node/v6.10.1/lib/node_modules/tiny-care-terminal/node_modules/twit/lib/twitter.js:329:5)
    at Request.<anonymous> (/home/liam/.nvm/versions/node/v6.10.1/lib/node_modules/tiny-care-terminal/node_modules/twit/lib/twitter.js:341:7)
    at emitOne (events.js:101:20)
    at Request.emit (events.js:188:7)
    at Gunzip.<anonymous> (/home/liam/.nvm/versions/node/v6.10.1/lib/node_modules/tiny-care-terminal/node_modules/request/request.js:1091:12)
    at Gunzip.g (events.js:291:16)
    at emitNone (events.js:91:20)
    at Gunzip.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)

(Also, thank you for writing this app! :heart:)

notwaldorf commented 7 years ago

Uhhhhhh I have no idea how to reproduce this, unfortunately :( It seems that you didn't receive a tweet for one of the accounts you listed. Did you change any of the defaults?

liamjones commented 7 years ago

Nope, all are with the default accounts. Hmm, possibly our broadband connection got interrupted? I'll see if I can come up with some way to reproduce this...

notwaldorf commented 7 years ago

I can add a null check so that it doesn't crash out (because i wrote sloppy code lol) but uhhhh i don't know what would happen! i guess it would show nothing, which is a mild improvement over it crashing, i guess :D

mojoaxel commented 6 years ago

I have no idea how this could even happen!

return $(".js-tweet-text.tweet-text").map(function() {
   return $(this).text();
}).get();

As I see it the map function should not be called if $(".js-tweet-text.tweet-text") is empty. My only explanation is a bug in the map function of the used version of jquery.

I'm closing for now. Please reopen or comment if you encounter the problem again!!