launchdarkly / android-client-sdk

LaunchDarkly Client-side SDK for Android
Other
45 stars 23 forks source link

fix: registered LDStatusListeners are now sent updates that result from a call to LDClient.identify(...) #274

Closed tanderson-ld closed 2 months ago

tanderson-ld commented 2 months ago

Requirements

Related issues

https://app.shortcut.com/launchdarkly/story/211876/android-sdk-connectioninformation-and-listeners-not-updated-correctly

Describe the solution you've provided

The issue was introduced in version 4.X and is has affected 2 major versions. The root of the issue is that from 3.x to 4.x, the code that sets the connection mode and kicks the last successful connection timestamp was moved out of the connectivity manager, so reconnects (which are handled inside the connectivity manager), were not handled. The fix is to adjust the code so that cconnection information / connection timestamps are kicked when the reconnect logic succeeds or fails.

Describe alternatives you've considered

Refactoring to match iOS's logic of emitting an offline event when reconnecting. This would more closely match 3.x. This was rejected as not having a good ratio of work required and risk involved. It also could introduce unexpected behavior for customers that implemented LDStatusListeners in version 4.x and 5.x.