diff --git a/evaluator.go b/evaluator.go index f53190d..9072e6b 100644 --- a/evaluator.go +++ b/evaluator.go @@ -22,7 +22,7 @@ type evalResult struct { SecondaryExposures []SecondaryExposure `json:"secondary_exposures"` UndelegatedSecondaryExposures []SecondaryExposure `json:"undelegated_secondary_exposures"` ConfigDelegate string `json:"config_delegate"` - ExplicitParameters map[string]bool `json:"explicit_parameters"` + ExplicitParameters []string `json:"explicit_parameters"` EvaluationDetails *EvaluationDetails `json:"evaluation_details,omitempty"` IsExperimentGroup *bool `json:"is_experiment_group,omitempty"` } @@ -429,12 +429,7 @@ func (e *evaluator) evalDelegate(user User, rule configRule, exposures []Seconda result.ConfigDelegate = rule.ConfigDelegate result.SecondaryExposures = e.cleanExposures(append(exposures, result.SecondaryExposures...), context.Hash) result.UndelegatedSecondaryExposures = exposures - - explicitParams := map[string]bool{} - for _, s := range config.ExplicitParameters { - explicitParams[s] = true - } - result.ExplicitParameters = explicitParams + result.ExplicitParameters = config.ExplicitParameters return result } diff --git a/logger.go b/logger.go index 6f6b6ff..e3ec98e 100644 --- a/logger.go +++ b/logger.go @@ -230,7 +230,12 @@ func (l *logger) getLayerExposureWithEvaluationDetails( context *logContext) *ExposureEvent { allocatedExperiment := "" exposures := evalResult.UndelegatedSecondaryExposures - isExplicit := evalResult.ExplicitParameters[parameterName] + isExplicit := false + for _, s := range evalResult.ExplicitParameters { + if s == parameterName { + isExplicit = true + } + } if isExplicit { allocatedExperiment = evalResult.ConfigDelegate diff --git a/user_persistent_storage_interface.go b/user_persistent_storage_interface.go index fa65465..2e3e102 100644 --- a/user_persistent_storage_interface.go +++ b/user_persistent_storage_interface.go @@ -10,7 +10,7 @@ type StickyValues struct { SecondaryExposures []SecondaryExposure `json:"secondary_exposures"` Time int64 `json:"time"` ConfigDelegate string `json:"config_delegate,omitempty"` - ExplicitParameters map[string]bool `json:"explicit_parameters,omitempty"` + ExplicitParameters []string `json:"explicit_parameters,omitempty"` UndelegatedSecondaryExposures []SecondaryExposure `json:"undelegated_secondary_exposures"` }