kaaholst / android-squeezer

Remote control for your Logitech Media Server ("Squeezeserver" etc) and players.
Apache License 2.0
77 stars 17 forks source link

Automatic reconnect doesn't work anymore since version 2.2.4 #702

Closed eremem closed 3 years ago

eremem commented 3 years ago

There seems to be a regression from #640 introduced in the current version (2.2.4). It looks like it may be related to #660...

After updating to the mentioned version on my 2 different devices (Android 10 & 11), the application, after bringing it to the foreground, recognizes the lost connection, looks for the server, finds it and... doesn't reconnect. I can reproduce this behavior most of the time. Previously it worked as expected every time.

Now if it happens, you still can reconnect manually by pressing the button. The LMS works OK, the network too, all my clients play the music w/o any problems all the time.

kaaholst commented 3 years ago

Yes this is probably related to #640. Version 2.2.4 will only attempt to reconnect a lost connection once, after which it goes to the connect screen. You then have to manually connect.

This is to avoid an endless loop because on some devices/networks apparently we were able to connect but the connection was lost shortly after, which caused an endless loop of lost connection and reconnect.

When Squeezer is first started (i.e if the app has been completely stopped) it still connects automatically. I will try implement this same behaviour for the scenario you describe of bringing the app to the foreground.

Thanks for the feedback.

eremem commented 3 years ago

To be honest, I have never witnessed any connection problems during fresh starts. It would be great though, if "at least" this current annoying behavior while bringing the app from the background could be fixed (fingers crossed). I suppose, if the problem can be reduced to an endless connection loop, maybe a few more attempts (5 or 10, instead of 1) before exiting the loop could be an easy fix?

Anyway, thank you guys for your work and this great application.

TheOriginalOrthonormal commented 3 years ago

In 2.2.6, when I bring up the app from the background after a few hours of inactivity, it goes directly to the "connect to server" dialog form.

kaaholst commented 3 years ago

From version 2.2.7 squeezer will try to connect when brought to foreground.

Thank you!