3urobeat / steam-comment-service-bot

📡 The most advanced Steam Account Manager Bot with mass coordinated comments/likes/favs/follows and plugin support
https://steamcommunity.com/id/3urobeatscommentbot
GNU General Public License v3.0
274 stars 40 forks source link

Bot can crash on comment request after automatic reconnect with limited error #54

Closed 3urobeat closed 4 years ago

3urobeat commented 4 years ago

Describe the bug Bot crashes sometimes when trying to process a requested comment after having lost connection to Steam.

Full error

[2020-07-15 01:11:01] [Bot 1] Lost connection to Steam. EResult: 3 | Message: NoConnection
[2020-07-15 01:11:01] [Main] Lost connection to Steam. EResult: 3 | Message: NoConnection
[2020-07-15 01:11:01] [Bot 3] Lost connection to Steam. EResult: 3 | Message: NoConnection
[2020-07-15 01:11:01] [Bot 4] Lost connection to Steam. EResult: 3 | Message: NoConnection
[2020-07-15 01:11:01] [Bot 2] Lost connection to Steam. EResult: 3 | Message: NoConnection
[2020-07-15 01:13:32] [Bot 1] Account logged in! Waiting for websession...
[2020-07-15 01:13:58] [Bot 1] Got websession and set cookies.
[2020-07-15 01:13:58] [Bot 1] Accepting offline friend & group invites...
[2020-07-15 01:14:07] [Bot 3] Account logged in! Waiting for websession...
[2020-07-15 01:14:14] [Bot 3] Got websession and set cookies.
[2020-07-15 01:14:14] [Bot 3] Accepting offline friend & group invites...
[2020-07-15 01:14:47] [Bot 2] Account logged in! Waiting for websession...
[2020-07-15 01:14:53] [Bot 2] Got websession and set cookies.
[2020-07-15 01:14:53] [Bot 2] Accepting offline friend & group invites...
[2020-07-15 01:14:59] [Bot 4] Account logged in! Waiting for websession...
[2020-07-15 01:15:00] [Bot 4] Got websession and set cookies.
[2020-07-15 01:15:00] [Bot 4] Accepting offline friend & group invites...
[2020-07-15 01:15:33] [Main] Account logged in! Waiting for websession...
[2020-07-15 01:15:34] [Main] Got websession and set cookies.
[2020-07-15 01:15:34] [Main] Accepting offline friend & group invites...
[2020-07-15 01:15:59] [Main] Friend message from 76561198801098870: !comment 2
/home/pi/Desktop/steam-comment-service-bot-master/src/bot.js:380
              if (controller.botobject[i].limitations.limited == true && !Object.keys(controller.botobject[i].myFriends).includes(steam64id)) {
                                                      ^

TypeError: Cannot read property 'limited' of null
    at SteamUser.<anonymous> (/home/pi/Desktop/steam-comment-service-bot-master/src/bot.js:380:55)
    at SteamUser.emit (events.js:180:13)
    at SteamUser._emitIdEvent (/home/pi/Desktop/steam-comment-service-bot-master/node_modules/steam-user/components/utility.js:28:12)
    at SteamUser.<anonymous> (/home/pi/Desktop/steam-comment-service-bot-master/node_modules/steam-user/components/chatroom.js:56:8)
    at handlers.forEach (/home/pi/Desktop/steam-comment-service-bot-master/node_modules/steam-user/components/classes/HandlerManager.js:37:12)
    at Array.forEach (<anonymous>)
    at HandlerManager.emit (/home/pi/Desktop/steam-comment-service-bot-master/node_modules/steam-user/components/classes/HandlerManager.js:36:12)
    at SteamUser._handleMessage (/home/pi/Desktop/steam-comment-service-bot-master/node_modules/steam-user/components/messages.js:543:24)
    at SteamUser._handleNetMessage (/home/pi/Desktop/steam-comment-service-bot-master/node_modules/steam-user/components/messages.js:478:7)
    at SteamUser.processMulti (/home/pi/Desktop/steam-comment-service-bot-master/node_modules/steam-user/components/messages.js:570:9)
3urobeat commented 4 years ago

Implemented a try catch block to prevent the bot from crashing. This error seems to be rare and I hope this try catch block is enough for now.
This issue will stay open until the patch is in the master branch.
The patch will be included in (beta-testing branch) BETA 2.8 b5 and (master branch) 2.8.

3urobeat commented 4 years ago

Fixed in commit 091d7bd (Version 2.8).