@@ -811,11 +811,10 @@ internal OptimizelyDecision Decide(OptimizelyUserContext user,
811
811
var decisionSource = flagDecisionResult . ResultObject ? . Source ?? FeatureDecision . DECISION_SOURCE_ROLLOUT ;
812
812
if ( ! allOptions . Contains ( OptimizelyDecideOption . DISABLE_DECISION_EVENT ) )
813
813
{
814
- SendImpressionEvent ( flagDecisionResult . ResultObject ? . Experiment , variation , userId , userAttributes , config , key , decisionSource , featureEnabled ) ;
815
- decisionEventDispatched = true ;
814
+ decisionEventDispatched = SendImpressionEvent ( flagDecisionResult . ResultObject ? . Experiment , variation , userId , userAttributes , config , key , decisionSource , featureEnabled ) ;
816
815
}
817
816
var decisionReasons = flagDecisionResult . DecisionReasons ;
818
- var reasonsToReport = decisionReasons . ToReport ( allOptions . Contains ( OptimizelyDecideOption . INCLUDE_REASONS ) ) ;
817
+ var reasonsToReport = decisionReasons . ToReport ( allOptions . Contains ( OptimizelyDecideOption . INCLUDE_REASONS ) ) . ToArray ( ) ;
819
818
var variationKey = flagDecisionResult . ResultObject ? . Variation ? . Key ;
820
819
821
820
// TODO: add ruleKey values when available later. use a copy of experimentKey until then.
@@ -828,7 +827,7 @@ internal OptimizelyDecision Decide(OptimizelyUserContext user,
828
827
{ "variables" , variableMap } ,
829
828
{ "variationKey" , variationKey } ,
830
829
{ "ruleKey" , ruleKey } ,
831
- { "reasons" , decisionReasons } ,
830
+ { "reasons" , reasonsToReport } ,
832
831
{ "decisionEventDispatched" , decisionEventDispatched }
833
832
} ;
834
833
@@ -842,7 +841,7 @@ internal OptimizelyDecision Decide(OptimizelyUserContext user,
842
841
ruleKey ,
843
842
key ,
844
843
user ,
845
- reasonsToReport . ToArray ( ) ) ;
844
+ reasonsToReport ) ;
846
845
}
847
846
848
847
internal Dictionary < string , OptimizelyDecision > DecideAll ( OptimizelyUserContext user ,
@@ -929,7 +928,7 @@ private void SendImpressionEvent(Experiment experiment, Variation variation, str
929
928
/// <param name="userAttributes">The user's attributes</param>
930
929
/// <param name="flagKey">It can either be experiment key in case if ruleType is experiment or it's feature key in case ruleType is feature-test or rollout</param>
931
930
/// <param name="ruleType">It can either be experiment in case impression event is sent from activate or it's feature-test or rollout</param>
932
- private void SendImpressionEvent ( Experiment experiment , Variation variation , string userId ,
931
+ private bool SendImpressionEvent ( Experiment experiment , Variation variation , string userId ,
933
932
UserAttributes userAttributes , ProjectConfig config ,
934
933
string flagKey , string ruleType , bool enabled )
935
934
{
@@ -941,7 +940,7 @@ private void SendImpressionEvent(Experiment experiment, Variation variation, str
941
940
var userEvent = UserEventFactory . CreateImpressionEvent ( config , experiment , variation , userId , userAttributes , flagKey , ruleType , enabled ) ;
942
941
if ( userEvent == null )
943
942
{
944
- return ;
943
+ return false ;
945
944
}
946
945
EventProcessor . Process ( userEvent ) ;
947
946
@@ -958,6 +957,7 @@ private void SendImpressionEvent(Experiment experiment, Variation variation, str
958
957
NotificationCenter . SendNotifications ( NotificationCenter . NotificationType . Activate , experiment , userId ,
959
958
userAttributes , variation , impressionEvent ) ;
960
959
}
960
+ return true ;
961
961
}
962
962
963
963
/// <summary>
0 commit comments