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 #33

Closed
jenshenneberg opened this issue Mar 1, 2024 · 3 comments
Closed

Feat: Add option for get gate with default value #33

jenshenneberg opened this issue Mar 1, 2024 · 3 comments
Labels

Comments

@jenshenneberg
Copy link
Contributor

jenshenneberg commented Mar 1, 2024

I'm working on adding a statsig provider for .net and I am facing the same issue as described for GO sdk and Java sdk

Problem
(Copied from statsig-io/java-server-sdk#22)
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
add:
public static bool CheckGateSync(StatsigUser user, string gateName, bool fallback)

@linear linear bot added Dotnet .NET and removed Dotnet labels Mar 5, 2024
@jenshenneberg jenshenneberg changed the title feat: add option for get gate with default value Feat: Add option for get gate with default value Mar 14, 2024
@linear linear bot closed this as completed Apr 9, 2024
@jenshenneberg
Copy link
Contributor Author

@tore-statsig : For some reason this feature request has been closed as completed, but I don't think it has been. Would you mind taking a look?

@kenny-statsig
Copy link
Contributor

kenny-statsig commented Apr 9, 2024

@jenshenneberg Sorry about that, the issue was auto-closed from our task management integration.
Though we aren't directly supporting a default return value, the new GetFeatureGate API allows you to fallback to a different default value based on the evaluation reason. So in your example, you can check if the evaluation reason is Unrecognized and then choose true. Hope that makes sense.

@jenshenneberg
Copy link
Contributor Author

@kenny-statsig : Thanks for that. That new API is very helpful and has allowed me to fix the issue in the OpenFeature provider for statsig.

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

No branches or pull requests

2 participants