Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ cache:
branches:
only:
- master
- /^\d+\.\d+\.\d+(-SNAPSHOT|-alpha|-beta)?\d*$/ # trigger builds on tags which are semantically versioned to ship the SDK.
- /^\d+\.\d+\.(\d|[x])+(-SNAPSHOT|-alpha|-beta)?\d*$/ # trigger builds on tags which are semantically versioned to ship the SDK.
after_success:
- ./gradlew coveralls uploadArchives --console plain
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Optimizely Java X SDK Changelog

## 2.1.3

September 21st, 2018

### Bug Fixes
* fix(attributes): Filters out attributes with null values from the event payload ([#204](https://github.com/optimizely/java-sdk/pull/204))

## 2.1.2

August 1st, 2018
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,19 @@ public LogEvent createConversionEvent(@Nonnull ProjectConfig projectConfig,
private List<Attribute> buildAttributeList(ProjectConfig projectConfig, Map<String, String> attributes) {
List<Attribute> attributesList = new ArrayList<Attribute>();

for (Map.Entry<String, String> entry : attributes.entrySet()) {
for (Map.Entry<String, ?> entry : attributes.entrySet()) {
// Filter down to the types of values we're allowed to track.
// Don't allow Longs, BigIntegers, or BigDecimals - they /can/ theoretically be serialized as JSON numbers
// but may take on values that can't be faithfully parsed by the backend.
// https://developers.optimizely.com/x/events/api/#Attribute
if (entry.getValue() == null ||
!((entry.getValue() instanceof String) ||
(entry.getValue() instanceof Integer) ||
(entry.getValue() instanceof Double) ||
(entry.getValue() instanceof Boolean))) {
continue;
}

String attributeId = projectConfig.getAttributeId(projectConfig, entry.getKey());
if(attributeId == null) {
continue;
Expand Down