Skip to content

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

Merged
merged 10 commits into from
Oct 17, 2018

Conversation

mnoman09
Copy link
Contributor

Note: first we have to merge #219 PR

@msohailhussain msohailhussain requested review from mikeproeng37 and a team October 2, 2018 20:54
@coveralls
Copy link

coveralls commented Oct 2, 2018

Pull Request Test Coverage Report for Build 695

  • 51 of 53 (96.23%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 89.247%

Changes Missing Coverage Covered Lines Changed/Added Lines %
core-api/src/main/java/com/optimizely/ab/Optimizely.java 15 17 88.24%
Totals Coverage Status
Change from base Build 691: 0.05%
Covered Lines: 2490
Relevant Lines: 2790

💛 - Coveralls

Copy link
Contributor

@thomaszurkan-optimizely thomaszurkan-optimizely left a 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) {
Copy link
Contributor

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.

Copy link
Contributor

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.

@msohailhussain
Copy link
Contributor

msohailhussain commented Oct 3, 2018

@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
@mnoman09 mnoman09 changed the title fix: Removed filtering of unknown attributes and assignment of empty map to null attributes. fix: Removed filtering of unknown attributes and assignment of empty map to null attributes and null event tags. Oct 4, 2018
@mikeproeng37
Copy link
Contributor

build

2 similar comments
@mikeproeng37
Copy link
Contributor

build

@mikeproeng37
Copy link
Contributor

build

mnoman09 and others added 3 commits October 10, 2018 12:53
# 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
Copy link
Contributor

@thomaszurkan-optimizely thomaszurkan-optimizely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mikeproeng37 mikeproeng37 merged commit da3b24f into master Oct 17, 2018
@mnoman09 mnoman09 deleted the mnoman/removedFilterAttributeCheck branch January 18, 2019 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants