growthbook / growthbook-sdk-java

The Java SDK for GrowthBook (JVM, Android)
https://docs.growthbook.io/lib/java
MIT License
7 stars 10 forks source link

isOn() does not return info whether the feature is enabled #41

Closed lsergio closed 3 weeks ago

lsergio commented 5 months ago

Per the sdk documentation: image

isOn() should tell me whether is feature is enabled. But instead it inspects the value of the feature and returns true if the value is a positive number, a non-empty string or true.

So, if I have a feature that is enabled on any environment, but the default value is 0 per my business rules, the sdk will return false for isOn. If this is intentional, we might change the docs, and maybe add a isEnabled(featureName) method.

lsergio commented 5 months ago

In my scenario, I'm trying to check if these toggles are on or off, regardless of the feature value: image

So for now I inspected the features json manually instead of using the sdk.

vazarkevych commented 4 weeks ago

Hi, we have fixed this issue. Here is a pull request for it (https://github.com/growthbook/growthbook-sdk-java/pull/65).