cfdp / opeka

Counseling chat service, built for providing anonymous help to young people at risk
https://curachat.com
GNU General Public License v3.0
10 stars 6 forks source link

TypeError: Cannot read property 'id' of undefined #46

Closed benjamin-dk closed 7 years ago

benjamin-dk commented 8 years ago

Seems we have another bug relating to removeUserFromRoom:

11 Nov 16:50:15 - Admin user added to room 3005c776-e5a4-4e2a-8cd4-57f30e878544
2015-11-11T18:41:37.123Z - ^[[32minfo^[[39m: Admin user disconnected. 74e4f903-5eed-45b9-9ade-74c611df3d47
2015-11-11T18:41:37.296Z - ^[[32minfo^[[39m: Logout: User chat start:  24121010
2015-11-11T18:41:37.313Z - ^[[32minfo^[[39m: Logout: User chat end:  24121122
2015-11-11T18:41:37.313Z - ^[[31mwarning^[[39m: Last admin user disconnected - shutting down room. Counselor id:  74e4f903-5eed-45b9-9ade-74c611df3d47

/home/chat/opeka/nodejs/lib/opeka.js:1017
      checkPause = (activeRoomId === room.id);
                                         ^
TypeError: Cannot read property 'id' of undefined
    at Server.self.removeUserFromRoom (/home/chat/opeka/nodejs/lib/opeka.js:1017:42)
    at /home/chat/opeka/nodejs/lib/opeka.js:963:14
    at Array.forEach (native)
    at /home/chat/opeka/nodejs/lib/opeka.js:947:37
    at process._tickCallback (node.js:415:13)
error: Forever detected script exited with code: 8
error: Script restart attempt #41
benjamin-dk commented 8 years ago

This error happened again today - same pattern:

2016-03-16T20:01:12.818Z - ^[[32minfo^[[39m: Admin user disconnected. 64ab7dec-62da-4787-a0ab-72e256ed608b
2016-03-16T20:01:12.830Z - ^[[32minfo^[[39m: Logout: User chat start:  24302460
2016-03-16T20:01:12.830Z - ^[[32minfo^[[39m: Logout: User chat end:  24302641
2016-03-16T20:01:12.831Z - ^[[31mwarning^[[39m: Last admin user disconnected - shutting down room. Counselor id:  64ab7dec-62da-4787-a0ab-72e256ed608b

/home/chat/opeka/nodejs/lib/opeka.js:1017
      checkPause = (activeRoomId === room.id);
                                         ^
TypeError: Cannot read property 'id' of undefined
    at Server.self.removeUserFromRoom (/home/chat/opeka/nodejs/lib/opeka.js:1017:42)
    at /home/chat/opeka/nodejs/lib/opeka.js:963:14
    at Array.forEach (native)
    at /home/chat/opeka/nodejs/lib/opeka.js:947:37
    at process._tickCallback (node.js:415:13)
error: Forever detected script exited with code: 8