niehusst/partyq-android

Spotify service crash

Closed this issue · 6 comments

Not super frequently, but maybe 1/4 parties, the SpotifyBgService ends up crashing, leaving the party silent and unable to resume, but still in PartyActivity.

Ideally, there would be some way to recover from this without losing the party?

Still no idea what causes this, or how we could detect and/or fix it autonomously.
But a manual workaround appears to be to:

  1. when music stops when there are still songs in the queue,
  2. click the "open spotify" link causing Spotify to start playing the song it should be,
  3. Spotify then begins obeying partyq once again (at least for a little while)

maybe an issue with auto play code?

trying to skip song during this issue results in following error from spotify (but is silent, so does not affect partyq unless listening for the error)
com.spotify.protocol.client.error.RemoteClientException: {"message":"Cannot skip song: [UNKNOWN]"}

trying to skip song during this issue results in following error from spotify (but is silent, so does not affect partyq unless listening for the error)
com.spotify.protocol.client.error.RemoteClientException: {"message":"Cannot skip song: [UNKNOWN]"}

This error may only indicate that since Spotify isn't playing a song, it can't be skipped. (UNKNOWN == null?)

Try setting an observer on spotifyAppRemote?.playerApi?.playerState (although its async callback data fetch so could be tough/weird?) so we can see if player API isn't playing anything when it should be (compare head of queue).

If a way to fix this automatically could be found, that would be cool, but an intuitive manual fix is passable for now.