@@ -838,16 +838,14 @@ export default class StatsigStore {
838
838
gateName : string ,
839
839
ignoreOverrides = false ,
840
840
) : StoreGateFetchResult {
841
- const gateNameHash = this . getHashedSpecName ( gateName ) ;
842
841
let gateValue : APIFeatureGate = {
843
842
name : gateName ,
844
843
value : false ,
845
844
rule_id : '' ,
846
845
secondary_exposures : [ ] ,
847
846
} ;
848
847
let details : EvaluationDetails ;
849
- const userGateOverride =
850
- this . overrides . gates [ gateNameHash ] ?? this . overrides . gates [ gateName ] ;
848
+ const userGateOverride = this . overrides . gates [ gateName ] ;
851
849
if ( ! ignoreOverrides && userGateOverride != null ) {
852
850
gateValue = {
853
851
name : gateName ,
@@ -861,8 +859,8 @@ export default class StatsigStore {
861
859
) ;
862
860
} else {
863
861
const value =
864
- this . userValues ?. feature_gates [ gateNameHash ] ??
865
- this . userValues ?. feature_gates [ gateName ] ;
862
+ this . userValues ?. feature_gates [ gateName ] ??
863
+ this . userValues ?. feature_gates [ this . getHashedSpecName ( gateName ) ] ;
866
864
if ( value ) {
867
865
gateValue = value ;
868
866
}
@@ -873,15 +871,9 @@ export default class StatsigStore {
873
871
}
874
872
875
873
public getConfig ( configName : string , ignoreOverrides = false ) : DynamicConfig {
876
- const configNameHash = this . getHashedSpecName ( configName ) ;
877
874
let configValue : DynamicConfig ;
878
875
let details : EvaluationDetails ;
879
- const userConfigValue =
880
- this . userValues ?. dynamic_configs [ configNameHash ] ??
881
- this . userValues ?. dynamic_configs [ configName ] ;
882
- const userConfigOverride =
883
- this . overrides . configs [ configNameHash ] ??
884
- this . overrides . configs [ configName ] ;
876
+ const userConfigOverride = this . overrides . configs [ configName ] ;
885
877
if ( ! ignoreOverrides && userConfigOverride != null ) {
886
878
details = this . getEvaluationDetails (
887
879
false ,
@@ -898,16 +890,22 @@ export default class StatsigStore {
898
890
this . sdkInternal . getCurrentUser ( ) ,
899
891
) ,
900
892
) ;
901
- } else if ( userConfigValue != null ) {
902
- details = this . getEvaluationDetails ( true ) ;
903
- configValue = this . createDynamicConfig (
904
- configName ,
905
- userConfigValue ,
906
- details ,
907
- ) ;
908
893
} else {
909
- details = this . getEvaluationDetails ( false ) ;
910
- configValue = new DynamicConfig ( configName , { } , '' , details ) ;
894
+ const userConfigValue =
895
+ this . userValues ?. dynamic_configs [ configName ] ??
896
+ this . userValues ?. dynamic_configs [ this . getHashedSpecName ( configName ) ] ;
897
+
898
+ if ( userConfigValue != null ) {
899
+ details = this . getEvaluationDetails ( true ) ;
900
+ configValue = this . createDynamicConfig (
901
+ configName ,
902
+ userConfigValue ,
903
+ details ,
904
+ ) ;
905
+ } else {
906
+ details = this . getEvaluationDetails ( false ) ;
907
+ configValue = new DynamicConfig ( configName , { } , '' , details ) ;
908
+ }
911
909
}
912
910
913
911
return configValue ;
@@ -920,9 +918,7 @@ export default class StatsigStore {
920
918
) : DynamicConfig {
921
919
let exp : DynamicConfig ;
922
920
let details : EvaluationDetails ;
923
- const expNameHash = this . getHashedSpecName ( expName ) ;
924
- const userExpOverride =
925
- this . overrides . configs [ expNameHash ] ?? this . overrides . configs [ expName ] ;
921
+ const userExpOverride = this . overrides . configs [ expName ] ;
926
922
if ( ! ignoreOverrides && userExpOverride != null ) {
927
923
details = this . getEvaluationDetails (
928
924
false ,
@@ -951,10 +947,7 @@ export default class StatsigStore {
951
947
layerName : string ,
952
948
keepDeviceValue : boolean ,
953
949
) : Layer {
954
- const layerHashedName = this . getHashedSpecName ( layerName ) ;
955
- const userLayerOverride =
956
- this . overrides . layers [ layerHashedName ] ??
957
- this . overrides . layers [ layerName ] ;
950
+ const userLayerOverride = this . overrides . layers [ layerName ] ;
958
951
if ( userLayerOverride != null ) {
959
952
const details = this . getEvaluationDetails (
960
953
false ,
@@ -1077,10 +1070,9 @@ export default class StatsigStore {
1077
1070
name : string ,
1078
1071
topLevelKey : 'layer_configs' | 'dynamic_configs' ,
1079
1072
) : APIDynamicConfig | undefined {
1080
- const hash = this . getHashedSpecName ( name ) ;
1081
1073
return (
1082
- this . userValues ?. [ topLevelKey ] ?. [ hash ] ??
1083
- this . userValues ?. [ topLevelKey ] ?. [ name ]
1074
+ this . userValues ?. [ topLevelKey ] ?. [ name ] ??
1075
+ this . userValues ?. [ topLevelKey ] ?. [ this . getHashedSpecName ( name ) ]
1084
1076
) ;
1085
1077
}
1086
1078
0 commit comments