Closed anawu2006 closed 1 week ago
Hi @anawu2006 , thank you for reporting this. We believe this bug has been in the code base since 4.x and has been overlooked. We have filed this internally as 211876.
Could you tell us a bit about how you are using the listener in your code base and the impact of this bug on your application? This will help us prioritize it against other issues. Thank you for taking the time to report!
@tanderson-ld you are correct, this bug exists in 4.x as well.
In our app, having a new successful connection to LD server is one of the conditions when switching users/contexts. So after identifying, we wait until LDStatusListener.onConnectionModeChanged
gets triggered with a new connectionInformation.lastSuccessfulConnection
value.
With this issue, we are not able to switch users/contexts successfully. Any other suggested solutions to identify a new successful connection to server after identifying? Thanks.
Sorry for the delay @anawu2006 . Could you try setOffline(), identify, then setOnline()? I think that is enough to get the connection manager to change states.
@tanderson-ld no worries and that is exactly what I had put up to bypass this issue. Thanks.
@anawu2006 , this issue should now be fixed in version 5.3.1 which was just released. Please be aware that the SDK may send multiple updates in quick succession with just the last connection timestamp updated.
Is this a support request? No
Describe the bug In SDK 3.6.0,
LDClient.get().connectionInformation
will get updated with a newlastSuccessfulConnection
value after identifying to a different user, but not in 5.0.0.To reproduce
LDClient
withldContext1
and register aLDStatusListener
ldContext2
:LDClient.get().connectionInformation
doesn't get updated andLDStatusListener.onConnectionModeChanged
doesn't get triggered.Expected behavior
LDClient.get().connectionInformation
should be updated with a newlastSuccessfulConnection
value and LDStatusListener.onConnectionModeChanged` should be triggered.Logs None.
SDK version 5.0.0
Language version, developer tools Android Kotlin, API 34
OS/platform Android 13
Additional context I have checked the source code of
ConnectivityManager.setStatus
and noticed thatLastSuccessfulConnection
value won't be updated if theConnectionMode
doesn't change. I think the connection information should be updated in this case given theLDContext
changed. But feel free to close this out if you don't think so.