Skip to content

Revert "[FSSDK-11448] Java Implementation: Add Experiment ID and Variation ID to Decision Notification" #567

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
6 changes: 0 additions & 6 deletions core-api/src/main/java/com/optimizely/ab/Optimizely.java
Original file line number Diff line number Diff line change
Expand Up @@ -1303,8 +1303,6 @@ private OptimizelyDecision createOptimizelyDecision(
ProjectConfig projectConfig
) {
String userId = user.getUserId();
String experimentId = null;
String variationId = null;

Boolean flagEnabled = false;
if (flagDecision.variation != null) {
Expand Down Expand Up @@ -1338,8 +1336,6 @@ private OptimizelyDecision createOptimizelyDecision(


Boolean decisionEventDispatched = false;
experimentId = flagDecision.experiment != null ? flagDecision.experiment.getId() : null;
variationId = flagDecision.variation != null ? flagDecision.variation.getId() : null;

Map<String, Object> attributes = user.getAttributes();
Map<String, ?> copiedAttributes = new HashMap<>(attributes);
Expand All @@ -1366,8 +1362,6 @@ private OptimizelyDecision createOptimizelyDecision(
.withRuleKey(ruleKey)
.withReasons(reasonsToReport)
.withDecisionEventDispatched(decisionEventDispatched)
.withExperimentId(experimentId)
.withVariationId(variationId)
.build();
notificationCenter.send(decisionNotification);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,6 @@ public static class FlagDecisionNotificationBuilder {
public final static String RULE_KEY = "ruleKey";
public final static String REASONS = "reasons";
public final static String DECISION_EVENT_DISPATCHED = "decisionEventDispatched";
public final static String EXPERIMENT_ID = "experimentId";
public final static String VARIATION_ID = "variationId";

private String flagKey;
private Boolean enabled;
Expand All @@ -376,8 +374,6 @@ public static class FlagDecisionNotificationBuilder {
private String ruleKey;
private List<String> reasons;
private Boolean decisionEventDispatched;
private String experimentId;
private String variationId;

private Map<String, Object> decisionInfo;

Expand Down Expand Up @@ -426,16 +422,6 @@ public FlagDecisionNotificationBuilder withDecisionEventDispatched(Boolean dispa
return this;
}

public FlagDecisionNotificationBuilder withExperimentId(String experimentId) {
this.experimentId = experimentId;
return this;
}

public FlagDecisionNotificationBuilder withVariationId(String variationId) {
this.variationId = variationId;
return this;
}

public DecisionNotification build() {
if (flagKey == null) {
throw new OptimizelyRuntimeException("flagKey not set");
Expand All @@ -453,8 +439,6 @@ public DecisionNotification build() {
put(RULE_KEY, ruleKey);
put(REASONS, reasons);
put(DECISION_EVENT_DISPATCHED, decisionEventDispatched);
put(EXPERIMENT_ID, experimentId);
put(VARIATION_ID, variationId);
}};

return new DecisionNotification(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,6 @@ public void decisionNotification() {
OptimizelyJSON variables = optimizely.getAllFeatureVariables(flagKey, userId);
String ruleKey = "exp_no_audience";
List<String> reasons = Collections.emptyList();
String experimentId = "10420810910";
String variationId = "10418551353";

final Map<String, Object> testDecisionInfoMap = new HashMap<>();
testDecisionInfoMap.put(FLAG_KEY, flagKey);
Expand All @@ -717,8 +715,6 @@ public void decisionNotification() {
testDecisionInfoMap.put(VARIABLES, variables.toMap());
testDecisionInfoMap.put(RULE_KEY, ruleKey);
testDecisionInfoMap.put(REASONS, reasons);
testDecisionInfoMap.put(EXPERIMENT_ID, experimentId);
testDecisionInfoMap.put(VARIATION_ID, variationId);

Map<String, Object> attributes = Collections.singletonMap("gender", "f");
OptimizelyUserContext user = optimizely.createUserContext(userId, attributes);
Expand Down
Loading