Skip to content

Commit

Permalink
Release (#74)
Browse files Browse the repository at this point in the history
* SDK_VERSION was updated

* fix multiple circular logs (#73)

Co-authored-by: Bohdan Akimenko <bohdan.akimenko@kevychsolutions.com>

---------

Co-authored-by: Bohdan Akimenko <bohdan.akimenko@kevychsolutions.com>
  • Loading branch information
vazarkevych and Bohdan-Kim committed Jun 25, 2024
1 parent 81b9295 commit 5cf1744
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions lib/src/main/java/growthbook/sdk/java/FeatureEvaluator.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ public <ValueType> FeatureResult<ValueType> evaluateFeature(
Class<ValueType> valueTypeClass,
JsonObject attributeOverrides
) throws ClassCastException {
featureEvalContext.setId(key);

// This callback serves for listening for feature usage events
FeatureUsageCallback featureUsageCallback = context.getFeatureUsageCallback();

Expand All @@ -46,9 +44,14 @@ public <ValueType> FeatureResult<ValueType> evaluateFeature(
.build();

try {
// block that handle recursion
log.info("evaluateFeature: circular dependency detected:");
if (featureEvalContext.getEvaluatedFeatures().contains(key)) {
// block that handle recursion
log.info(
"evaluateFeature: circular dependency detected: {} -> {}. { from: {}, to: {} }",
featureEvalContext.getId(), key,
featureEvalContext.getId(), key
);

FeatureResult<ValueType> featureResultWhenCircularDependencyDetected = FeatureResult
.<ValueType>builder()
.value(null)
Expand All @@ -62,6 +65,7 @@ public <ValueType> FeatureResult<ValueType> evaluateFeature(
}

featureEvalContext.getEvaluatedFeatures().add(key);
featureEvalContext.setId(key);

// Check for feature values forced by URL
if (context.getAllowUrlOverride()) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/main/java/growthbook/sdk/java/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
public class Version {
private Version() {}

static final String SDK_VERSION = "0.9.5";
static final String SDK_VERSION = "0.9.6";
}

0 comments on commit 5cf1744

Please sign in to comment.