Hello ! - Trying to upgrade from Java SDK 0.5.0 to 0.9.7 here, and i seem to encounter an undocument...
l
Hello ! • Trying to upgrade from Java SDK 0.5.0 to 0.9.7 here, and i seem to encounter an undocumented breaking behavior, but i really hope i'm wrong. • I notice that when doing
gb.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 ?
a
Hello, Albert! Thank you for reporting. We'll check it.
🙏 1
l
here's myFeature partial json
Copy code
"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")
a
There really was a trouble with
isOn()
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
Copy code
<dependency>
	    <groupId>com.github.growthbook</groupId>
	    <artifactId>growthbook-sdk-java</artifactId>
	    <version>issues~81-SNAPSHOT</version>
	</dependency>
l
hey thanks, but i'm encountering this ..
Copy code
org.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>)
I tried rerunning with
mvn -U -X clean test
.. and still the same error
a
we just restored
issues/81
branch. Can you please try now?
l
• Yay, that solved the problem ! 🎉 • Super thanks @ancient-car-96302 🙏 • Do you mind spilling out when this fix will be released ?
a
We plan to release when this pull request will be merged
0.9.8
version is available on Jitpack
🎉 1
l
That was swift, super thanks @ancient-car-96302 and team !