@@ -1499,9 +1499,7 @@ export default class Optimizely implements Client {
1499
1499
return newErrorDecision ( key , user , [ DECISION_MESSAGES . SDK_NOT_READY ] ) ;
1500
1500
}
1501
1501
1502
- const filteredOptions = options . filter ( option => option !== OptimizelyDecideOption . ENABLED_FLAGS_ONLY ) ;
1503
-
1504
- return this . decideForKeys ( user , [ key ] , filteredOptions ) [ key ] ;
1502
+ return this . decideForKeys ( user , [ key ] , options , true ) [ key ] ;
1505
1503
}
1506
1504
1507
1505
/**
@@ -1553,15 +1551,15 @@ export default class Optimizely implements Client {
1553
1551
const experimentKey = decisionObj . experiment ?. key ?? null ;
1554
1552
const variationKey = decisionObj . variation ?. key ?? null ;
1555
1553
const flagEnabled : boolean = decision . getFeatureEnabledFromVariation ( decisionObj ) ;
1554
+ const variablesMap : { [ key : string ] : unknown } = { } ;
1555
+ let decisionEventDispatched = false ;
1556
1556
1557
1557
if ( flagEnabled ) {
1558
1558
this . logger . log ( LOG_LEVEL . INFO , LOG_MESSAGES . FEATURE_ENABLED_FOR_USER , MODULE_NAME , key , userId ) ;
1559
1559
} else {
1560
1560
this . logger . log ( LOG_LEVEL . INFO , LOG_MESSAGES . FEATURE_NOT_ENABLED_FOR_USER , MODULE_NAME , key , userId ) ;
1561
1561
}
1562
1562
1563
- const variablesMap : { [ key : string ] : unknown } = { } ;
1564
- let decisionEventDispatched = false ;
1565
1563
1566
1564
if ( ! options [ OptimizelyDecideOption . EXCLUDE_VARIABLES ] ) {
1567
1565
feature . variables . forEach ( variable => {
@@ -1631,7 +1629,8 @@ export default class Optimizely implements Client {
1631
1629
decideForKeys (
1632
1630
user : OptimizelyUserContext ,
1633
1631
keys : string [ ] ,
1634
- options : OptimizelyDecideOption [ ] = [ ]
1632
+ options : OptimizelyDecideOption [ ] = [ ] ,
1633
+ ignoreEnabledFlagOption ?:boolean
1635
1634
) : Record < string , OptimizelyDecision > {
1636
1635
const decisionMap : Record < string , OptimizelyDecision > = { } ;
1637
1636
const flagDecisions : Record < string , DecisionObj > = { } ;
@@ -1651,6 +1650,10 @@ export default class Optimizely implements Client {
1651
1650
1652
1651
const allDecideOptions = this . getAllDecideOptions ( options ) ;
1653
1652
1653
+ if ( ignoreEnabledFlagOption ) {
1654
+ delete allDecideOptions [ OptimizelyDecideOption . ENABLED_FLAGS_ONLY ] ;
1655
+ }
1656
+
1654
1657
for ( const key of keys ) {
1655
1658
const feature = configObj . featureKeyMap [ key ] ;
1656
1659
if ( ! feature ) {
0 commit comments