-
Notifications
You must be signed in to change notification settings - Fork 32
fix: Removed filtering of unknown attributes and assignment of empty map to null attributes and null event tags. #221
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
Pull Request Test Coverage Report for Build 695
💛 - Coveralls |
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.
Why didn’t you just keep filters attributes method possibly rename to validate attributes and have it return a empty attribute or a copy of the attribute list passed in. A null in notification listeners attributes is definitely a breaking change. But, is it necessary?
It seems like making a copy at least could be valuable.
Just thought maybe we could/should discuss.
(entry.getValue() instanceof Double) || | ||
(entry.getValue() instanceof Boolean))) { | ||
continue; | ||
if (attributes != 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.
Rather than a large enclosed if != how about if == null continue; I think it reads better.
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.
Tom there is no for loop here and if attributes is not null then we have to build attribute list (for loop is inside if) from attributes and later on, we are also building attribute for bot filtering.
@thomaszurkan-optimizely We can discuss offline tomorrow, this is the part of audience match type, what is sent to attributes from APIs must be passed same to notification listener. @mikeng13 Tom is right, notification listener has nonnull attributes property which will not let the user to pass NULL, but if we by pass annotation validation, then it will cause problem. |
in UserAttribute.evaluate if attributes are null than assigns it into empty map. to avoid null pointer exception
…nt tag if passed null
build |
2 similar comments
build |
build |
# Conflicts: # core-api/src/main/java/com/optimizely/ab/config/audience/UserAttribute.java # core-api/src/main/java/com/optimizely/ab/event/internal/EventFactory.java
…ck' into mnoman/MakeCopyOfAttributes
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
Note: first we have to merge #219 PR