Skip to content

Commit

Permalink
FFM-6412 - Flags with multiple prerequisites evaluating incorrectly (#…
Browse files Browse the repository at this point in the history
…156)

FFM-6412 - Flags with multiple prerequisites evaluating incorrectly

What
Fix prerequisites loop in the evaluator code

Why
Only the first parent feature is being processed by the evalator due to the loop exiting too early.

Testing
TestEvaluations_ServerSDK
  • Loading branch information
andybharness authored Jul 4, 2023
1 parent f972833 commit 5a5140d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.harness.featureflags</groupId>
<artifactId>examples</artifactId>
<version>1.2.3</version>
<version>1.2.4</version>

<properties>
<maven.compiler.source>8</maven.compiler.source>
Expand All @@ -33,7 +33,7 @@
<dependency>
<groupId>io.harness</groupId>
<artifactId>ff-java-server-sdk</artifactId>
<version>1.2.3</version>
<version>1.2.4</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.harness</groupId>
<artifactId>ff-java-server-sdk</artifactId>
<version>1.2.3</version>
<version>1.2.4</version>
<packaging>jar</packaging>
<name>Harness Feature Flag Java Server SDK</name>
<description>Harness Feature Flag Java Server SDK</description>
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/io/harness/cf/client/api/Evaluator.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import static io.harness.cf.client.api.Operators.*;

import io.harness.cf.client.common.StringUtils;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.sangupta.murmur.Murmur3;
import com.sangupta.murmur.MurmurConstants;
import io.harness.cf.client.common.StringUtils;
import io.harness.cf.client.dto.Target;
import io.harness.cf.model.*;
import java.util.*;
Expand Down Expand Up @@ -341,7 +341,9 @@ protected boolean checkPreRequisite(FeatureConfig parentFeatureConfig, Target ta
element -> element.contains(preReqEvaluatedVariation.get().getIdentifier()))) {
return false;
} else {
return checkPreRequisite(preReqFeatureConfig.get(), target);
if (!checkPreRequisite(preReqFeatureConfig.get(), target)) {
return false;
}
}
}
}
Expand Down

0 comments on commit 5a5140d

Please sign in to comment.