Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: decision metadata enabled fix. #410

Merged
merged 6 commits into from
Nov 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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