-
Notifications
You must be signed in to change notification settings - Fork 30
FIX: Forced variation not available in experiment #237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -251,10 +251,9 @@ public function createImpressionEvent($config, $experimentId, $variationKey, $fl | |||
{ | |||
$eventParams = $this->getCommonParams($config, $userId, $attributes); | |||
$experiment = $config->getExperimentFromId($experimentId); | |||
$variation = $config->getFlagVariationByKey($flagKey, $variationKey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment above this line that mapped flagKey can be directly used in variation so no experimentKey exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
@@ -251,10 +251,9 @@ public function createImpressionEvent($config, $experimentId, $variationKey, $fl | |||
{ | |||
$eventParams = $this->getCommonParams($config, $userId, $attributes); | |||
$experiment = $config->getExperimentFromId($experimentId); | |||
$variation = $config->getFlagVariationByKey($flagKey, $variationKey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we need check empty both 'flagKey' (line 256) and 'experimentId' (line 260).
Also consider switching line 260 and 256 since 256 is common cases while 256 is for FD only and slow.
…and then checking $variation = $config->getFlagVariationByKey($flagKey, $variationKey);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good! Can we have a unit test covering these cases?
@@ -251,10 +251,9 @@ public function createImpressionEvent($config, $experimentId, $variationKey, $fl | |||
{ | |||
$eventParams = $this->getCommonParams($config, $userId, $attributes); | |||
$experiment = $config->getExperimentFromId($experimentId); | |||
$variation = $config->getFlagVariationByKey($flagKey, $variationKey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need a unit test covering this bug?
@mnoman09 ah ok, I was confused. all looks good! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Summary
Test plan
All unit test and FSC tests should pass