loud-hydrogen-50191
07/10/2024, 2:24 PMgb.isOn("myFeature")
multiple times on the same gb instance can result in non-deterministic result.
• I was getting true
variation at the first isOn(), and false
for the subsequent isOn()s.
• I notice this INFO: evaluateFeature: circular dependency detected: myFeature -> myFeature. { from: myFeature, to: myFeature }
• Per my understanding from 0.5.0 is that when calling isOn() multiple times
◦ The first call will trigger allocation + trigger callback with the experiment result
◦ The subsequent calls will not trigger allocation, and will just return the previous result, seems like it's cached + not triggering callback
◦ Thus the result is always deterministic, first call returns true, then subsequent calls will also return true
• Further checking i notice this new code that checks that if it's been evaluated before, it will return null, which translates to false for isOn(). And it says something about blocking recursion and prerequisite that i'm not using. Seems to be a new addition since 0.9.3
• Is this behavior expected since 0.9.3 ? Is there anything i'm missing to avoid this circular dependency issue ?ancient-car-96302
07/10/2024, 2:28 PMloud-hydrogen-50191
07/10/2024, 2:34 PM"myFeature": {
"defaultValue": true,
"rules": [
{
"variations": [
false,
true
],
"coverage": 1,
"weights": [
0.5,
0.5
],
"hashAttribute": "deviceId"
},
{
"condition": {
"deviceId": "test-myFeature-forced-on"
},
"force": true
}
]
}
In the code i just
• add the deviceId attribute with test-myFeature-forced-on
• isOn("myFeature")ancient-car-96302
07/10/2024, 2:43 PMisOn()
method. We had fixed the bug in issues/81
branch. We created a snapshot from this branch. Could you please try the snapshot?
https://jitpack.io/#growthbook/growthbook-sdk-java/issues~81-SNAPSHOT
<dependency>
<groupId>com.github.growthbook</groupId>
<artifactId>growthbook-sdk-java</artifactId>
<version>issues~81-SNAPSHOT</version>
</dependency>
loud-hydrogen-50191
07/10/2024, 2:51 PMorg.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project experimentation-be: Could not resolve dependencies for project com.codapayments:experimentation-be:jar:1.8.0: The following artifacts could not be resolved: com.github.growthbook:growthbook-sdk-java:jar:issues~81-SNAPSHOT (absent): Could not find artifact com.github.growthbook:growthbook-sdk-java:jar:issues~81-SNAPSHOT in <http://jitpack.io|jitpack.io> (<https://jitpack.io>)
loud-hydrogen-50191
07/10/2024, 2:59 PMmvn -U -X clean test
.. and still the same errorancient-car-96302
07/10/2024, 3:03 PMissues/81
branch. Can you please try now?loud-hydrogen-50191
07/10/2024, 3:11 PMancient-car-96302
07/10/2024, 3:15 PMancient-car-96302
07/10/2024, 6:45 PM0.9.8
version is available on Jitpackloud-hydrogen-50191
07/11/2024, 3:11 AM