kiwiirc / irc-framework

🛠️ A better IRC framework for node.js. For bots and full clients.
MIT License
182 stars 65 forks source link

Failing the initial connection attempt stops retries #178

Open hexjelly opened 6 years ago

hexjelly commented 6 years ago

I'm not sure if this is the intended behavior or not, but I noticed that if you try to connect to a server and it fails the first attempt, it will simply stop retrying any additional connections. It only seems to attempt retrying if you've had one successful connection at some point.

It was a bit unclear how the logic worked while quickly looking through the connection method, so I'm not 100% sure if that's how it's supposed to work? I ended up setting .connection.connected = true;and .connection.registered = true; manually before connecting which takes care of it, but of course that feels wrong and hacky :)

At least as a user, I would expect connect() to keep retrying no matter what (if the auto_reconnect option is true).