@@ -324,39 +324,39 @@ export default class EppoPrecomputedClient {
324
324
flagKey : string ,
325
325
defaultValue : string ,
326
326
) : Omit < IAssignmentDetails < string > , 'evaluationDetails' > {
327
- const banditEvaluation = this . getPrecomputedBandit ( flagKey ) ;
328
-
329
- if ( banditEvaluation == null ) {
330
- logger . warn ( `${ loggerPrefix } No assigned variation. Bandit not found: ${ flagKey } ` ) ;
327
+ const precomputedFlag = this . getPrecomputedFlag ( flagKey ) ;
328
+ console . log ( { precomputedFlag } ) ;
329
+ if ( ! precomputedFlag ) {
330
+ logger . warn ( `${ loggerPrefix } No assigned variation. Flag not found: ${ flagKey } ` ) ;
331
331
return { variation : defaultValue , action : null } ;
332
332
}
333
-
333
+ const banditEvaluation = this . getPrecomputedBandit ( flagKey ) ;
334
334
const assignedVariation = this . getStringAssignment ( flagKey , defaultValue ) ;
335
-
336
- const banditEvent : IBanditEvent = {
337
- timestamp : new Date ( ) . toISOString ( ) ,
338
- featureFlag : flagKey ,
339
- bandit : banditEvaluation . banditKey ,
340
- subject : this . subject . subjectKey ?? '' ,
341
- action : banditEvaluation . action ,
342
- actionProbability : banditEvaluation . actionProbability ,
343
- optimalityGap : banditEvaluation . optimalityGap ,
344
- modelVersion : banditEvaluation . modelVersion ,
345
- subjectNumericAttributes : banditEvaluation . actionNumericAttributes ,
346
- subjectCategoricalAttributes : banditEvaluation . actionCategoricalAttributes ,
347
- actionNumericAttributes : banditEvaluation . actionNumericAttributes ,
348
- actionCategoricalAttributes : banditEvaluation . actionCategoricalAttributes ,
349
- metaData : this . buildLoggerMetadata ( ) ,
350
- evaluationDetails : null ,
351
- } ;
352
-
353
- try {
354
- this . logBanditAction ( banditEvent ) ;
355
- } catch ( error ) {
356
- logger . error ( `${ loggerPrefix } Error logging bandit action: ${ error } ` ) ;
335
+ if ( banditEvaluation ) {
336
+ const banditEvent : IBanditEvent = {
337
+ timestamp : new Date ( ) . toISOString ( ) ,
338
+ featureFlag : flagKey ,
339
+ bandit : banditEvaluation . banditKey ,
340
+ subject : this . subject . subjectKey ?? '' ,
341
+ action : banditEvaluation . action ,
342
+ actionProbability : banditEvaluation . actionProbability ,
343
+ optimalityGap : banditEvaluation . optimalityGap ,
344
+ modelVersion : banditEvaluation . modelVersion ,
345
+ subjectNumericAttributes : banditEvaluation . actionNumericAttributes ,
346
+ subjectCategoricalAttributes : banditEvaluation . actionCategoricalAttributes ,
347
+ actionNumericAttributes : banditEvaluation . actionNumericAttributes ,
348
+ actionCategoricalAttributes : banditEvaluation . actionCategoricalAttributes ,
349
+ metaData : this . buildLoggerMetadata ( ) ,
350
+ evaluationDetails : null ,
351
+ } ;
352
+ try {
353
+ this . logBanditAction ( banditEvent ) ;
354
+ } catch ( error ) {
355
+ logger . error ( `${ loggerPrefix } Error logging bandit action: ${ error } ` ) ;
356
+ }
357
+ return { variation : assignedVariation , action : banditEvent . action } ;
357
358
}
358
-
359
- return { variation : assignedVariation , action : banditEvent . action } ;
359
+ return { variation : assignedVariation , action : null } ;
360
360
}
361
361
362
362
private getPrecomputedFlag ( flagKey : string ) : DecodedPrecomputedFlag | null {
0 commit comments