Skip to content

Commit

Permalink
fix: add backwards compatibility to internal filter (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-steinfeld authored Sep 27, 2021
1 parent 8baa62e commit 0316e85
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,13 @@ private Query getQueryForFilter(
}

if (attributeMetadataFilter.hasInternal()) {
andFilters.add(
new Filter(Op.EQ, ATTRIBUTE_INTERNAL_KEY, attributeMetadataFilter.getInternal()));
Filter internalFilter =
new Filter(Op.EQ, ATTRIBUTE_INTERNAL_KEY, attributeMetadataFilter.getInternal());
if (!attributeMetadataFilter.getInternal()) {
// For backwards compatibility, treat an attribute missing internal attribute as external
internalFilter = internalFilter.or(new Filter(Op.NOT_EXISTS, ATTRIBUTE_INTERNAL_KEY, null));
}
andFilters.add(internalFilter);
}

Filter queryFilter = new Filter();
Expand Down

0 comments on commit 0316e85

Please sign in to comment.