Closed t3hnar closed 2 years ago
You didn't say why it looks like a bug to you, so I don't know whether you're missing something, but here's a summary of what the intention is:
LDClient.isInitialized()
is intended to return true if the SDK has received flag data from LaunchDarkly at least once so far. That is the job of the data source component, so that's why it is delegating to dataSource.isInitialized()
.So, the specific scenarios that that first block is there to handle are:
dataStore.isInitialized()
, it returns true, indicating that we are using a database and we detected some flag data already in the database (either from a previous run of the application, or put there by another process such as the Relay Proxy). So, we use that data, and we print a warning ("using last known values from data store").ok makes sense, I was confused by similar naming [dataS]tore
with [dataS]ource
, and thought that those both are the same thing.
I'm closing the issue now.
Hey guys, I'm going through code in order to assess java client before adding is as dependency
I can see repeated pattern of two checks like:
https://github.com/launchdarkly/java-server-sdk/blob/main/src/main/java/com/launchdarkly/sdk/server/LDClient.java#L341
however
This should be either bug or I must be missing something. Could you please help?