aeirola / slack-irc-client

Use Slack as your IRC client
87 stars 16 forks source link

Creates multiple users in the IRC channel #7

Open Arthaey opened 8 years ago

Arthaey commented 8 years ago

I've been running slack-irc-client for a couple hours now. It initially created the user "arthaey1". It's since created "arthaey2" and "arthaey3". All three of these users are still in the channel now, cluttering things up. I had to kill & restart slack-irc-client to clear out the extra users.

Arthaey commented 8 years ago

Based on the bot messages, it looks like it did this close to once an hour: at 10:40am, 12:54pm, 1:42pm, and 2:41pm. (Not sure why it didn't happen at 11:40-something.)

aeirola commented 8 years ago

Hmm, sounds strange. Were there any network issues, or ping timeouts, during those times? Did the console log any disconnects or reconnects?

This sounds like an issue with node-irc (the IRC client library used by slack-irc-client). Could it be something similar to https://github.com/martynsmith/node-irc/issues/449?

Arthaey commented 8 years ago

My computer might have gone to sleep when I went to get coffee, but that wouldn't explain all of them and the regularity is suspicious.

Is there anything you can do from your end, even if it is a bug in node-irc?

aeirola commented 8 years ago

If the computer goes to sleep, it most likely kills the connection to IRC, and causes a reconnect when the computer wakes up again. The reconnect would then join with a new nick if the previous connection hasn't yet timed out on the IRC server side. The old connections should time out on the IRC server though, since there shouldn't be any responses to the PING messages on the older connections. Unless you somehow accidentally have multiple instances of slack-irc-client running.

If I'm able to replicate the behaviour, then I can try to fix the issue either in either slack-irc-client or in node-irc. A dump of the slack-irc-client console output would help a lot in figuring out the issue.

Since the connection tracking and reconnection logic isn't flawless, it is recommended to run slack-irc-client on a server instead of a laptop or desktop machine that will go to sleep.

Arthaey commented 8 years ago

I definitely only had one instance of slack-irc-client running.

Fair point about this being meant to be run on a server, rather than a desktop, though. I'll do that and it'll probably be a reasonable workaround to the problem.