question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reconnect not working

See original GitHub issue

Hi! I added a listener for the ‘close’ event in order to handle disconnections. I’m seeing the message in the logs but the bot is offline now. What I’m doing wrong? Thanks!

// handle disconnections
bot.on('close', function(data){
    console.log("Connection closed... Reconnecting.")
    bot.login();
});

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:2
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
WoLfuluscommented, Mar 23, 2017

Shouldn’t this be a part of the library itself?

var bot = new Slackbot({});

bot.on('message', function(ev) {
    if (ev.type == 'reconnect_url') {
        bot.wsUrl = ev.url;
        return;
    }
    // ... 
});

bot.on('close', function() {
    bot.connect();
});
0reactions
Clotonervocommented, Apr 16, 2020

I don’t know if this is still relevant, but I fixed this problem by adding to the source code a reconnect method. I was told by Slack Help Center that this is normal, and that simply what you need to do is call a method on the api to tell Slack that your app is still running. The reconnect method simply calls the method on the real time messaging api (rtm.connect) which to my understanding sends over a new url to set as your web socket. My pull request didn’t go through due to some weird error, and it doesn’t seem like anyone is still keeping tabs on this repository. For more clarification take a look at the slack-api documentation here: https://api.slack.com/methods/rtm.connect

Read more comments on GitHub >

github_iconTop Results From Across the Web

League of Legends Reconnect Loop Bug - 2022 Fix
In this tutorial, we'll walk through how you can get past the Reconnect loop in League of Legends.
Read more >
Reconnect feature not working : r/apexlegends - Reddit
Reconnect feature not working. Every time i get a connection time- out, It doesn't let me reconnect. I get an error code, then...
Read more >
How To Fix League Of Legends Reconnect Error | NEW in 2022
Solution #4: Restart the router. ... In case there's a minor bug in your network, another troubleshooting step that you can consider doing...
Read more >
Fix a "Reconnect me" error - Android - Chromecast Help
Step 1. Check the internet access · If the network is online and the issue gets fixed after you reboot the router, then...
Read more >
Reconnect is not working anymore - Answers HQ
It is pretty strange that it wouldn't even attempt to reconnect you. Have you been able to try any sort of troubleshooting at...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found