Comments (9)
Can confirm it stalls here.
from plugapi.
Yep. I've been experiencing this one as well.
from plugapi.
On a whim, I tried moving the reconnect event from setImmediate([...])
to setTimeout([...], 5000)
just to see if adding a delay made a difference, no dice there. It seems as though that had no effect.
Hopefully I can get some time to try and actually debug this a little further. Doesn't help that my machine didn't boot after the Yosemite update this morning... 😢 🔫
from plugapi.
@Swingline0 I did the same thing, with the same results. However, initially I made a typo (setTimeOut), which resulted in an exit from the application. Recycling the bot in the script file was already built in.
I now do a process.exit(101) and process.exit(102) for the Socket Server Error and Socket Server Closed events, catch these errorlevels in the shell script, pause a minute and then restart the bot. That seems to work. Which leads me to believe that the slug may be invalid...? It's hard to test this when you don't know if the error is within your local code or within the plug code... 😃
from plugapi.
Totally, @ronaldb !
I'm using PM2 to run our bot so something similar would be a great temporary solution. Good idear.
This seems like a particularly annoying problem as it occurs so unpredictably. I've added some more logging to try and get a better idea of what the problem might be. Maybe that will reveal something.
from plugapi.
It's 4am for me, hopefully this makes sense and is helpful somehow.
In an attempt keep the bot running and just create a new PlugAPI instance. I've found the authCode is only updated once. Doing _authCode = '';
before reconnecting, events go through, and everything seems happy.
EDIT: Also, having the bot get the code from the room it's joining (i.e. https://plug.dj/roomslug) instead of https://plug.dj, doesn't fire a leave event. Making it look like the bot refreshed the page.
from plugapi.
That fixed it for me. Using the latest unmodified plugAPI:
15 Nov 13:28:11 [WARNING] [PlugAPI] [Socket Server] Closed with code 1000
15 Nov 13:28:11 [INFO] [PlugAPI] [Socket Server] Reconnecting
15 Nov 13:28:13 [SUCCESS] [PlugAPI] [Socket Server] Connected
Joined :eggplant:
ansj-s test
15 Nov 13:41:36 [WARNING] [PlugAPI] [Socket Server] Closed with code 1000
15 Nov 13:41:36 [INFO] [PlugAPI] [Socket Server] Reconnecting
15 Nov 13:41:38 [SUCCESS] [PlugAPI] [Socket Server] Connected
Joined :eggplant:
ansj-s asdf
from plugapi.
That sounds great, because this was a big issue before we can release a new version of plugAPI to npm.
Now all that's left should be to add the missing methods.
from plugapi.
Yup confirmed fixed as well.
from plugapi.
Related Issues (20)
- Errors in callback functions passed to playlist methods are mishandled HOT 2
- Should treat URLs as atoms when splitting long chat messages HOT 5
- Use ES6 Promise in place of callbacks HOT 5
- The advance event when last DJ finishes has djs.length == 2 HOT 2
- getPlaylists callback argument is not a RESTCallback HOT 6
- Chat events mentions are always [] HOT 3
- Duplicate advance event on skip (some times) HOT 2
- Playlist management functions some times silently fail HOT 5
- Cannot read property 'length' of undefined HOT 3
- Bot gets 403 error, restarts at random intervals HOT 7
- addToWaitList throws 403 error when target user has no playlists HOT 3
- Errors trying to perform npm install plugapi HOT 2
- Error after connection with account without playlist HOT 2
- Not sure if playlist functions are working properly
- Unsupported events
- User.language is null HOT 2
- Room Description HOT 8
- Convert name to ID? HOT 8
- Have a bot.
- I'm using your api for a plug bot
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plugapi.