creesch / discordIRCd

A node.js script that allows you to connect to discord with your irc client.
Apache License 2.0
115 stars 21 forks source link

Crash on guild leave #25

Closed Scrxtchy closed 7 years ago

Scrxtchy commented 7 years ago

When using the web client, if I leave a guild using the web interface, my IRC connection drops and the deamon crashes.

/mnt/mpathag/scratch/node/discordIRCd/server.js:555
        ircDetails[discordServerId].channels[newChannel.name] = {
                                   ^

TypeError: Cannot read property 'channels' of undefined
    at Client.<anonymous> (/mnt/mpathag/scratch/node/discordIRCd/server.js:555:36)
    at emitOne (events.js:96:13)
    at Client.emit (events.js:189:7)
    at ClientDataManager.newChannel (/mnt/mpathag/scratch/node/discordIRCd/node_modules/discord.js/src/client/ClientDataManager.js:69:51)
    at Guild.setup (/mnt/mpathag/scratch/node/discordIRCd/node_modules/discord.js/src/structures/Guild.js:179:68)
    at new Guild (/mnt/mpathag/scratch/node/discordIRCd/node_modules/discord.js/src/structures/Guild.js:65:12)
    at ClientDataManager.newGuild (/mnt/mpathag/scratch/node/discordIRCd/node_modules/discord.js/src/client/ClientDataManager.js:23:19)
    at GuildCreateHandler.handle (/mnt/mpathag/scratch/node/discordIRCd/node_modules/discord.js/src/client/websocket/packets/handlers/GuildCreate.js:17:26)
    at WebSocketPacketManager.handle (/mnt/mpathag/scratch/node/discordIRCd/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:120:65)
    at WebSocketManager.eventMessage (/mnt/mpathag/scratch/node/discordIRCd/node_modules/discord.js/src/client/websocket/WebSocketManager.js:273:31)

What's interesting is that this guild wasn't connected via the deamon at all, was only part of it for approximately three minutes

creesch commented 7 years ago

There is already an issue for this

https://github.com/creesch/discordIRCd/issues/9

So I am closing this one in favor of that one.

What currently happens when you start server.js is that it indexes everything and for channels and users updates that whenever things change. For servers I simply haven't gotten around implementing something similar.

Which is first on my list.

Scrxtchy commented 7 years ago

Thanks