tkem / mopidy-mobile

Mopidy Web client extension and hybrid app for mobile devices
Apache License 2.0
78 stars 14 forks source link

Improve reconnect handling #223

Open tkem opened 6 years ago

tkem commented 6 years ago

Users report that Mopidy Mobile can turn into a real CPU hog when not being able to connect to the Mopidy server, e.g. because the server has been shut down. This is probably due to our rather "aggressive" reconnect handling, with backoffDelayMax set to 2000 milliseconds. Setting this to a higher value has its downsides as well, of course, so maybe making this configurable might be a good idea.

tkem commented 6 years ago

Another option would be to re-evaluate Cordova pause and resume events to detect when the app is put into the background, and change backoff settings accordingly, or disconnect altogether. However, there were some issues with pause/resume (details lost in time) when this was initially implemented.

tkem commented 6 years ago

At least reconnecting on resume may improve interaction with the MusicControls plugin somewhat.