fix: 6779 compose source filters into $and - #6891
Merged
Merged
Conversation
Pyatakov
force-pushed
the
fix/6779-compose-source-filters
branch
2 times, most recently
from
September 10, 2026 20:47
c9cd314 to
2fee32a
Compare
Source filters were assigned onto filter[field], so two filters on the same field overwrote each other and the dropped constraint let the source validation fail open or closed depending on the order. Every predicate now goes into $and, so repeated fields compose. Signed-off-by: Alex Piatakov <alex.piatakov@hashgraph.com>
Pyatakov
force-pushed
the
fix/6779-compose-source-filters
branch
from
September 10, 2026 20:49
2fee32a to
133c032
Compare
dariy-rised
approved these changes
Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
documentValidatorBlockbuilt its source query by assigning each configured filter ontofilter[field], so two filters on the same field overwrote each other. The surviving one decided whether the source validation admitted documents it was meant to exclude or rejected ones it was meant to admit, and nothing reported the dropped constraint.$andinstead of assigning ontofilter[field], so repeated fields composepolicyId,schema,owner,group,assignedTo,assignedToGroup) as direct keys, since each is emitted at most once$andunset when a source validation configures no filtersA duplicated field is deliberately not reported as a config error: with predicates composing, a range bound plus an exclusion on one field is a valid configuration.
Closes #6779