Conversation
A clause on a PreventFilter property, or on an unknown property with AllowUnknownProperties, became (true == true). Under an OR, this made the whole filter match every row, so Name == "Ann" || Secret == "s" returned everyone. IgnoredClauseBehavior now defaults to Remove, so QueryKit drops the clause and keeps the rest of the filter. Set it to ReplaceWithTrue to get the v1.14.2 behavior. BREAKING CHANGE: A prevented or unknown clause is now removed, not replaced with (true == true). Under an OR, the filter returns fewer rows. A filter with only ignored clauses becomes x => True. Set IgnoredClauseBehavior to ReplaceWithTrue to keep the v1.14.2 behavior.
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.
For later consideration in a major version. Do not merge now. #122 made
ReplaceWithTruethe default to keep v1.x non-breaking. This PR makesRemovethe default again.The
IgnoredClauseBehaviorsetting stays. A consumer can set it toReplaceWithTrueto keep the v1.14.2 behavior.Summary
PreventFilterproperty, or on an unknown property withAllowUnknownProperties, becomesTrue == True.x => True.new QueryKitConfiguration(s => s.IgnoredClauseBehavior = IgnoredClauseBehavior.ReplaceWithTrue)gives the v1.14.2 behavior.IQueryKitConfiguration: getsRemove. These configurations cannot opt out, because the setting is only onQueryKitConfiguration.true == truemakes the whole filter match every row. SoName == "Ann" || Secret == "s"returns everyone. WithRemove, QueryKit drops the clause and keeps the rest of the filter. The result is what the caller asked for, without the prevented part.Related: #112 asks for a setting to ignore or throw on prevented properties.
Throwcan join the same enum.Evidence
With
SecretmarkedPreventFilter, rows Ann, Bob, and Cid, and the filterFirstName == "Ann" || Secret == "s":Under AND, the rows are the same. Only the expression text changes.
Tests, changed from the restore tests:
dotnet teston this branch: all unit and integration tests pass, 0 failures.Merge Danger
Door: two-way
A later release can change the default back. Consumers can opt out now with one setting.
Blast Radius: consumers
Trueor a shorter expression in place of(True == True).