Fix tracking callback invocation#135
Conversation
…eriment and experiment result for tracking callback invocation
# Conflicts: # lib/src/main/java/growthbook/sdk/java/evaluators/FeatureEvaluator.java
|
|
||
| // Add the experiment to the tracker if it doesn't exist. | ||
| if (!experimentTracker.isExperimentTracked(key)) { | ||
| experimentTracker.trackExperiment(key); |
There was a problem hiding this comment.
We use an Experiment Tracker to keep track of the most recent experiments set with a bounded max val of 30(which can be changed). Changing this implementation to a unbounded hashSet will grow significantly when there are multiple instances of GrowthBookClient is created.
There was a problem hiding this comment.
We’ve restored your implementation of the Experiment Tracker as suggested.
| @Nullable | ||
| private Map<String, Object> globalForcedFeatureValues; | ||
|
|
||
| private ExperimentHelper experimentHelper = new ExperimentHelper(); |
There was a problem hiding this comment.
Options is not a place for initializing experimentHelper. Options technically provides all configurable parameters that influence the behavior of GrowthBook instance.
There was a problem hiding this comment.
Ok, we have moved the Experiment Tracker to the Global Context. We need this instance to be a singleton in order to track experiments and their results properly — only once. Previously, it was being recreated during every evaluation process
…cker to GlobalContext to make it singleton, remove ExperimentHelper from Options class
…eriment and experiment result for tracking callback invocation