-
Notifications
You must be signed in to change notification settings - Fork 38
bring back getVariable(String,Integer,Double,Boolean) #200
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
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.
Looks mostly good, just have one small thing to fix
* @return the live variable to retrieve for the given variable key | ||
* | ||
*/ | ||
private LiveVariable getLiveVariable(ProjectConfig projectConfig, String variableKey) { |
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.
I think we should null-check the variableKey
since it is a user-provided input or we can do it at a higher level, like the caller of this function
@NonNull Map<String, String> attributes, | ||
boolean activateExperiment) { | ||
|
||
if (!isValid()) { |
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.
Let's null-check the userId
and variableKey
input params here
} | ||
|
||
if (variableKey == null || variableKey.isEmpty()) { | ||
logger.warn("Invalid live variable key (null or empty) " + |
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.
I'd make the argument for making these error
logs so the developer will be more inclined to fix it or null-check on their end before passing to us.
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, just one more suggestion
unit tests added as well.