jeromeludmann / deno-irc

IRC client protocol module for Deno
https://deno.land/x/irc
MIT License
12 stars 4 forks source link

Exception in createNicklist on quit event from other users #10

Closed aronson closed 10 months ago

aronson commented 10 months ago

Hello, I bring a strange issue I've been trying to debug in the production instance of my discord-irc fork. We love your library and it's been fantastic.

We're getting an exception in the createNicklist function that only crops up occasionally.

image

It seems to be immediately after a user quits the application bubbles up this exception. I've tried to reproduce it in my test environment but I don't get the exception on user quit. We plan to run the prod instance with a debugger at some point to see if we can get you more useful information for debugging.

Has anyone seen this problem before? We reboot the instance automatically for now with minimal downtime.

jeromeludmann commented 10 months ago

Thank you for reporting it.

I am not really sure about the cause. For some reasons, names[nick] has an unexpected undefined value. It should have an empty array (at least, not undefined value).

I added a defensive check on another branch (the change is here https://github.com/jeromeludmann/deno-irc/commit/90f503bef9965452581bf982ce2bf5610b2541d4). You can test it by replacing your import:

import { Client } from "https://raw.githubusercontent.com/jeromeludmann/deno-irc/nicklist-bug/mod.ts";

You can use this workaround for some days.

Let me know if it solves something related to quit events.

I will try to investigate further.

aronson commented 10 months ago

Thank you for the prompt fix. We've been running it for a while now and haven't seen the exception since making the change.

jeromeludmann commented 10 months ago

Hello, you can replace your current version number by v0.14.1.

I should do more tests about this case, maybe with discord-irc in order to be able to reproduce it. From what I saw, I don't really understand how this crash could happen.

aronson commented 10 months ago

Thanks, main project upgraded!

Feel free to reach out on my contact info or repo if you want/need help setting up discord-irc for testing purposes. Always happy to help. If you're curious about how we're using your library the bulk of the IRC-related code is here

Closing this issue out for now