You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that this happens when the connection has been idling for too long or the internet connection has gone down and up again. I would love an automatic reconnect, which I tried to hack really quick but failed. If I have time I'll take another stab at it.
TypeError: Cannot call method 'send' of null
at Spotify.sendCommand (node_modules/spotify-web/lib/spotify.js:492:13)
at Spotify.sendProtobufRequest (node_modules/spotify-web/lib/spotify.js:603:8)
at Spotify.rootlist (node_modules/spotify-web/lib/spotify.js:833:8)
The text was updated successfully, but these errors were encountered:
Like the automatic reconnect idea, not sure how feasible it is though. Like it should be easy to queue up messages, connect first then send out all buffered messages after (re)connection, however the problem I see is with all the stuff that is meant to happen after connection but before sending commands, like authentication. We could cache authentication, but I'm pretty sure we currently don't.
At the very least, I would consider this bug fixed if we start checking if the websocket object exists before sending, and if it doesn't throwing/emitting a 'not connected' exception/error.
P.S. There should have been a heartbeat going back and forth, so idling shouldn't cause the problem, more likely it was a connection failure.
I think that this happens when the connection has been idling for too long or the internet connection has gone down and up again. I would love an automatic reconnect, which I tried to hack really quick but failed. If I have time I'll take another stab at it.
The text was updated successfully, but these errors were encountered: