Skip to content
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

feat: add option for get gate with default value #32

Open
liran2000 opened this issue Feb 21, 2024 · 0 comments
Open

feat: add option for get gate with default value #32

liran2000 opened this issue Feb 21, 2024 · 0 comments

Comments

@liran2000
Copy link

Background

In continue of OpenFeature PR, it is a common practice to evaluate a boolean/gate with a default value:

BooleanEvaluation(ctx context.Context, flag string, defaultValue bool, evalCtx of.FlattenedContext)

Problem

BooleanEvaluation with default value true cannot fallback to true.
On scenarios such as get gate of non-existing gate, statsig returns false without indication of whether it was successful get gate or some error reason. Therefore, the evaluation will be evaluated to false in this case.

Suggested solution

  1. Similar to dynamic config function GetString(key string, fallback string), add:
GetGate(user User, gate string, fallback bool) FeatureGate
  1. Enrich FeatureGate with error and reason.

@kenny-statsig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant