Closed NanderTGA closed 10 months ago
I think this may be related to my poor handling of user-join
and user-leave
events for blocked users.
The client.isBlocked
function recently started blocking bots too (by default), which explains why this started happening recently.
:tada: This issue has been resolved in version 2.0.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Recently, Yabluzo and other bots on recent versions have started crashing now and then. I have been aware of this issue for some time now and have been able to log some of the events that caused one of these undefined errors. These logs indicate that a
message
event is sometimes handled before theuser-join
event assigns a new user toclient.users
. However, this is impossible because these event handlers are all synchronous and socket.io guarantees that all events are received (and thus have their event handlers run) in the same order they were sent.My conclusion is that
client.users[user]
must be undefined for some other reason. I think this may be related to a recent change that introduced blocking bots using Sheesh's bot API. I have also noticed that the crashes seem to happen for bots or people who have the same ID as a bot. I will investigate further.