Skip to content

Commit

Permalink
Add filter types conflict log message (#543)
Browse files Browse the repository at this point in the history
  • Loading branch information
gthea authored Sep 27, 2023
1 parent 5e93c2d commit f00e6b2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/main/java/io/split/android/client/FilterBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ private void addFilters(List<SplitFilter> filters) {
if (filter.getType() == SplitFilter.Type.BY_SET) {
// BY_SET filter has precedence over other filters, so we remove all other filters
// and only add BY_SET filters
Logger.w("SDK Config: The Set filter is exclusive and cannot be used simultaneously with names or prefix filters. Ignoring names and prefixes");
if (!containsSetsFilter) {
mFilters.clear();
containsSetsFilter = true;
Expand All @@ -96,9 +97,9 @@ private void addFilters(List<SplitFilter> filters) {

private void validateFilterSize(SplitFilter.Type type, int size) {
if (size > type.maxValuesCount()) {
String message = "Error: " + type.maxValuesCount() + " different split " + type.queryStringField() +
String message = "Error: " + type.maxValuesCount() + " different feature flag " + type.queryStringField() +
" can be specified at most. You passed " + size
+ ". Please consider reducing the amount or using prefixes to target specific groups of splits.";
+ ". Please consider reducing the amount or using prefixes to target specific groups of feature flags.";
throw new IllegalArgumentException(message);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/split/android/client/SplitFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public int maxValuesCount() {
case BY_PREFIX:
return 50;
case BY_SET:
return 1000;
return 999999;
default:
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/split/android/client/SyncConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static Builder builder() {
}

public static class Builder {
private List<SplitFilter> mBuilderFilters = new ArrayList<>();
private final List<SplitFilter> mBuilderFilters = new ArrayList<>();
private int mInvalidValueCount = 0;
private final SplitValidator mSplitValidator = new SplitValidatorImpl();

Expand Down

0 comments on commit f00e6b2

Please sign in to comment.