adorable-cpu-56223
05/01/2024, 3:55 PMdef evaluateFeature(
feature: String,
experimentAttributes: String,
): FeatureResult[String] = {
GrowthBook.setAttributes(experimentAttributes)
GrowthBook.evalFeature(feature, classOf[String])
}
The issue is that at any given time N concurrent calls of that can be made. Each call tries to set the attributes but the problem arises when client X sets attributes, then client Y sets attributes, and immediately after that client X calls GrowthBook.evalFeature
and the attributes being used are from client Y and not client X. The issue is that this is including some of our subjects in experiments when it shouldn’t be because they would not actually fit the targeting conditions.
One way to fix this is to instantiate a GrowthBook instance per client so that it has its own context, but I know that is not recommended. Do you guys have any good solution for this type of problem? cc: @rhythmic-agency-4145adorable-cpu-56223
05/01/2024, 3:55 PMadorable-cpu-56223
05/01/2024, 3:58 PMrhythmic-agency-4145
05/01/2024, 4:04 PMrhythmic-agency-4145
05/01/2024, 4:07 PM