@@ -39,7 +39,7 @@ export function clientFactory(params: ISdkFactoryContext): SplitIO.IClient | Spl
3939 const { log, mode } = settings ;
4040 const isAsync = isConsumerMode ( mode ) ;
4141
42- function getTreatment ( key : SplitIO . SplitKey | undefined , featureFlagName : string , attributes ?: SplitIO . Attributes , options ?: SplitIO . EvaluationOptions , withConfig = false , methodName = GET_TREATMENT ) {
42+ function getTreatment ( key : SplitIO . SplitKey , featureFlagName : string , attributes ?: SplitIO . Attributes , options ?: SplitIO . EvaluationOptions , withConfig = false , methodName = GET_TREATMENT ) {
4343 const stopTelemetryTracker = telemetryTracker . trackEval ( withConfig ? TREATMENT_WITH_CONFIG : TREATMENT ) ;
4444
4545 const wrapUp = ( evaluationResult : IEvaluationResult ) => {
@@ -134,12 +134,15 @@ export function clientFactory(params: ISdkFactoryContext): SplitIO.IClient | Spl
134134 function processEvaluation (
135135 evaluation : IEvaluationResult ,
136136 featureFlagName : string ,
137- key : SplitIO . SplitKey | undefined ,
137+ key : SplitIO . SplitKey ,
138138 properties : string | undefined ,
139139 withConfig : boolean ,
140140 invokingMethodName : string ,
141141 queue : ImpressionDecorated [ ]
142142 ) : SplitIO . Treatment | SplitIO . TreatmentWithConfig {
143+ const matchingKey = getMatching ( key ) ;
144+ const bucketingKey = getBucketing ( key ) ;
145+
143146 const { changeNumber, impressionsDisabled } = evaluation ;
144147 let { treatment, label, config = null } = evaluation ;
145148
@@ -150,11 +153,7 @@ export function clientFactory(params: ISdkFactoryContext): SplitIO.IClient | Spl
150153 config = fallbackTreatment . config ;
151154 }
152155
153- // If no target/key, no impression is tracked
154- if ( key && validateSplitExistence ( log , readinessManager , featureFlagName , label , invokingMethodName ) ) {
155- const matchingKey = getMatching ( key ) ;
156- const bucketingKey = getBucketing ( key ) ;
157-
156+ if ( validateSplitExistence ( log , readinessManager , featureFlagName , label , invokingMethodName ) ) {
158157 log . info ( IMPRESSION_QUEUEING , [ featureFlagName , matchingKey , treatment , label ] ) ;
159158 queue . push ( {
160159 imp : {
0 commit comments