@@ -30,7 +30,7 @@ import {
30
30
} from '../constants' ;
31
31
import { decodeFlag } from '../decoding' ;
32
32
import { EppoValue } from '../eppo_value' ;
33
- import { Evaluator , FlagEvaluation , noneResult } from '../evaluator' ;
33
+ import { Evaluator , FlagEvaluation , noneResult , overrideResult } from '../evaluator' ;
34
34
import { BoundedEventQueue } from '../events/bounded-event-queue' ;
35
35
import EventDispatcher from '../events/event-dispatcher' ;
36
36
import NoOpEventDispatcher from '../events/no-op-event-dispatcher' ;
@@ -963,28 +963,13 @@ export default class EppoClient {
963
963
const flagEvaluationDetailsBuilder = this . newFlagEvaluationDetailsBuilder ( flagKey ) ;
964
964
const overrideVariation = this . overridesStore ?. get ( flagKey ) ;
965
965
if ( overrideVariation ) {
966
- const overrideAllocationKey = 'override-' + overrideVariation . key ;
967
- const flagEvaluationDetails = flagEvaluationDetailsBuilder
968
- . setMatch (
969
- 0 ,
970
- overrideVariation ,
971
- { key : overrideAllocationKey , splits : [ ] , doLog : false } ,
972
- null ,
973
- undefined ,
974
- )
975
- . build ( 'MATCH' , 'Flag override applied' ) ;
976
-
977
- return {
966
+ return overrideResult (
978
967
flagKey ,
979
968
subjectKey ,
980
- variation : overrideVariation ,
981
969
subjectAttributes ,
982
- flagEvaluationDetails,
983
- doLog : false ,
984
- format : '' ,
985
- allocationKey : 'override' ,
986
- extraLogging : { } ,
987
- } ;
970
+ overrideVariation ,
971
+ flagEvaluationDetailsBuilder ,
972
+ ) ;
988
973
}
989
974
990
975
const configDetails = this . getConfigDetails ( ) ;
0 commit comments