Last update seemed to cause some serious state restoration proplem’s when coming back to the app when it was killed, many of you propably did see the empty “music service” list in the home screen, i’m sorry for that.(for time being force closing the app fixes this, and propably using the device switching functionality aswell)
I believe i found a cure for that, and at the same time fixed one similar bug which did happen from time to time since version 1 of the app, the fix was actually so obvious that i feel bit stupid right now.
private val connectionStatus : SharedFlow<ConnectionResults> = connectionState
.shareIn(externalScope, SharingStarted.WhileSubscribed(), 1)
connectionState.value = ConnectionResults(ConnectionStatus.Connected)
connectionState.value = ConnectionResults(ConnectionStatus.Disconnected)
So basically the fix was to force checking the socket connecting status from the socket object itself, instead of relying the cached state , and since the first very first thing the app does when it launches is to start listening this event, it should now always receive a state which it can safely use determinate what it should do.(before the state could be restored somewhere in between connected and disconnected, which in rare occasion was false state and we got stuck)
i will try to do my best on testing bit more and release the update today later.