The contract of Initialized() is that it's supposed to return true forever once the client has received some data from LaunchDarkly.
This wasn't correct because Initialized() was delegating to IsInitializedSuccessfully(). This function returned true only for the Valid and Offline states. This is missing Interrupted, which the SDK might be in after having once been Valid.
Besides causing an incorrect result for Initialized() when the SDK's data source was interrupted, this affected logging when calling an evaluation method, emitting an incorrect message :
LaunchDarkly client has not yet been initialized. Returning cached value
Although the action is correct (returning cached value), the reason (has not yet initialized) is wrong. We don't need to log this message at all as an interrupted SDK is normal.
To fix, I've deleted the confusing internal IsInitialized method, which was really a proxy for checking state != initializing. I've modified IsInitializedSuccessfully to return true for Interrupted.
The contract of
Initialized()
is that it's supposed to return true forever once the client has received some data from LaunchDarkly.This wasn't correct because
Initialized()
was delegating toIsInitializedSuccessfully()
. This function returned true only for theValid
andOffline
states. This is missingInterrupted
, which the SDK might be in after having once beenValid
.Besides causing an incorrect result for
Initialized()
when the SDK's data source was interrupted, this affected logging when calling an evaluation method, emitting an incorrect message :Although the action is correct (
returning cached value
), the reason (has not yet initialized
) is wrong. We don't need to log this message at all as an interrupted SDK is normal.To fix, I've deleted the confusing internal
IsInitialized
method, which was really a proxy for checkingstate != initializing
. I've modifiedIsInitializedSuccessfully
to return true forInterrupted
.