Skip to content

Commit

Permalink
fix: decision metadata enabled fix. (#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
msohailhussain authored Nov 18, 2020
1 parent b551357 commit 3b3bb9a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions core-api/src/main/java/com/optimizely/ab/Optimizely.java
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ private void sendImpression(@Nonnull ProjectConfig projectConfig,
* @param ruleType It can either be experiment in case impression event is sent from activate or it's feature-test or rollout
*/
private void sendImpression(@Nonnull ProjectConfig projectConfig,
@Nonnull Experiment experiment,
@Nullable Experiment experiment,
@Nonnull String userId,
@Nonnull Map<String, ?> filteredAttributes,
@Nonnull Variation variation,
@Nullable Variation variation,
@Nonnull String flagKey,
@Nonnull String ruleType,
@Nonnull boolean enabled) {
Expand Down Expand Up @@ -425,15 +425,6 @@ private Boolean isFeatureEnabled(@Nonnull ProjectConfig projectConfig,
if (featureDecision.decisionSource != null) {
decisionSource = featureDecision.decisionSource;
}
sendImpression(
projectConfig,
featureDecision.experiment,
userId,
copiedAttributes,
featureDecision.variation,
featureKey,
decisionSource.toString(),
featureEnabled);

if (featureDecision.variation != null) {
// This information is only necessary for feature tests.
Expand All @@ -448,6 +439,15 @@ private Boolean isFeatureEnabled(@Nonnull ProjectConfig projectConfig,
featureEnabled = true;
}
}
sendImpression(
projectConfig,
featureDecision.experiment,
userId,
copiedAttributes,
featureDecision.variation,
featureKey,
decisionSource.toString(),
featureEnabled);

DecisionNotification decisionNotification = DecisionNotification.newFeatureDecisionNotificationBuilder()
.withUserId(userId)
Expand Down

0 comments on commit 3b3bb9a

Please sign in to comment.