Skip to content

[ENHANCEMENT] featureFlagKeyInvalid but for featureFlags #552

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

Closed
miquelalvarado opened this issue Apr 8, 2024 · 3 comments
Closed

[ENHANCEMENT] featureFlagKeyInvalid but for featureFlags #552

miquelalvarado opened this issue Apr 8, 2024 · 3 comments
Labels
acknowledged enhancement New feature or request

Comments

@miquelalvarado
Copy link

Description

Right now we have not an easy way to know if a feature flag key is invalid (not present in the datafile).
In the case of the activate method signature we can see that it can throw and one of its possible exceptions is experimentKeyInvalid which serves exactly to that purpose but for experiments.
My suggestion is to provide with the very same functionality but for feature flags.

Right now we can workaround it by doing optimizelyClient.getOptimizelyConfig().featuresMap[feature.rawValue] but it can be VERY slow as getOptimizelyConfig parses all the information each time is called.

I could do a PR if you want.

Benefits

Would be a fast way for clients to provide with default values for feature flags even when those are not yet created in optimizely.

Detail

No response

Examples

No response

Risks/Downsides

The only downside is that by doing it throwable we will force any client integrating the sdk to modify their current implementation to handle any possible exception but on the other hand we would normalize both experiments and feature flags APIs.

@miquelalvarado miquelalvarado added the enhancement New feature or request label Apr 8, 2024
@muzahidul-opti
Copy link
Contributor

Hi @miquelalvarado thanks for your feedback. We will get back to you soon.

@muzahidul-opti
Copy link
Contributor

Hi @miquelalvarado we would request you to use our decide api which is available in our latest release.

public func decide(key: String,  options: [OptimizelyDecideOption]? = nil) -> OptimizelyDecision

This will return an object to you with appropriate reasons if the flag key is invalid.

@muzahidul-opti
Copy link
Contributor

Hi @miquelalvarado I am going to close the issue. If you have any concerns, then please feel free to contact us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledged enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants