-
Notifications
You must be signed in to change notification settings - Fork 83
feat(api): Feature variable APIs now return default variable value when featureEnabled property is false. #249
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
) | ||
); | ||
var value = projectConfig.getVariableValueForVariation(this.configObj, variable, decision.variation, this.logger); | ||
if (value) { |
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.
Should this be value !== null
? What if value
is an empty string?
@@ -519,7 +519,8 @@ module.exports = { | |||
|
|||
var variableUsages = projectConfig.variationVariableUsageMap[variation.id]; | |||
var variableUsage = variableUsages[variable.id]; | |||
return variableUsage ? variableUsage.value : variable.defaultValue; | |||
|
|||
return variableUsage ? variableUsage.value : null; |
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 doc comment for this function is now incorrect, given this change.
…nto fahad/feature-enable-checking
build |
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.
Thanks @mfahadahmed, LGTM.
@jordangarcia are u going to review this PR? |
@msohailhussain can you address conflict. I can merge right after. |
…e-checking # Conflicts: # packages/optimizely-sdk/lib/optimizely/index.js
@aliabbasrizvi Conflicts resolved. Please take a look again. |
…nto fahad/feature-enable-checking
@msohailhussain can you address conflicts |
…e-checking # Conflicts: # packages/optimizely-sdk/lib/core/decision_service/index.tests.js # packages/optimizely-sdk/lib/optimizely/index.js
Summary
Test plan