-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Way to determine if feature flag exists #29
Comments
There is a less hacky workaround— it might or might not meet your needs, but I feel it's worth mentioning. Calling |
Anyway, regarding the basic idea of adding a "does this flag exist" method, it'd be straightforward to implement and we will definitely consider it. It does exist in at least one other SDK (going back to a time when we weren't as diligent about keeping the feature set consistent across SDKs), and wasn't added elsewhere because there had been very little demand for it as far as we knew. Most applications that use feature flags already know what flags they're using— or, if they are going to try to use a flag that might or might not exist, they are OK with the evaluation showing up in their analytics (I'm not quite clear on what you meant about "misleading evaluations"; maybe you could say more about why you would not want to record an evaluation for the flag even though you are using the flag?). But people do have use cases we don't anticipate. |
As for exposing the data store directly in the client API, we would prefer to avoid that; there is a high potential for causing confusion and unintended behavior, and it would make application developers more likely to rely on low-level implementation details as a first resort. That interface is exposed mainly because, in the current architecture, it must be in order to allow database integrations to be implemented outside of the package... but in future versions, the architecture might change in order to reduce that exposure. The more implementation details are exposed, the harder it is for us to make necessary changes to the internal data model to implement new features without having those be breaking changes from an application point of view. |
I called the metrics misleading because we are using a
I do understand not wanting to expose the IDataStore object. The GetFlag method would be sufficient - we only need to know that the flag exists - not how it evaluates. |
Is your feature request related to a problem? Please describe.
We would like a way to determine if a flag exists. Currently we have settings that are stored as app settings, feature flags, etc. When evaluating a value we check whether the flag exists in app settings, launchdarkly, etc to obtain the value.
Describe the solution you'd like
The simplest solution would be to expose the IDataStore instance in the LDClient. Alternatively, the GetFlag method could be exposed.
Describe alternatives you've considered
It may be possible that we could use an additional IDataStore instance that we manually create, though that seems less than ideal.
Additional context
Currently we are using the Evaluate call with a null user to LDClient - if the request fails because the flag is missing, then we know that the flag doesn't exist. If it fails because the user is null then we know that it does. This only works because the flag is checked before the user is checked. Obviously this is hacky and has ended up littering our logs and metrics with misleading evaluations.
The text was updated successfully, but these errors were encountered: