Giter VIP home page Giter VIP logo

Comments (3)

eli-darkly avatar eli-darkly commented on June 12, 2024

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:

  • There are two components with different purposes, the "data store" (which is either a simple in-memory store or a database) and the "data source" (which manages the connection to LaunchDarkly for getting flags).
  • 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().
  • Even if the SDK has not received flag data from LaunchDarkly, there could still be old flag data present in the data storeβ€” specifically, if the data store is a database. If so, we can use that data to evaluate flags, even though we would prefer to have more up-to-date flag data. That's what is going on in the first block you quoted.

from java-server-sdk.

eli-darkly avatar eli-darkly commented on June 12, 2024

So, the specific scenarios that that first block is there to handle are:

  1. The SDK has not (yet) completed a successful initialization because it has not been able to connect to LaunchDarkly. But, when it calls 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").
  2. Or, the SDK has not yet completed a successful initialization, and there is not already data in the data store. So we have no data, there is no way to evaluate flags, and we print a different warning ("data store unavailable").

from java-server-sdk.

t3hnar avatar t3hnar commented on June 12, 2024

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.

from java-server-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.