New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enforce query instance checking before it wrapper as a filter #5431
Conversation
return new QueryWrapperFilter(query); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the factory or could its logic be directly implemented in Queries.wrap?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that way I can exclude only this factor in the pom file from forbidden API checks - I can add a comment there!
+1 This is a more structured approach than the if/else in the place where QueryFilterWrapper was being used. |
We have the default QueryWrapperFilter as well as our custom one while our wrapper is explicitly marked as no_cache such that it will never be included in a cache. This was not consistenly used and caused several problems during tests where p/c related queries were used as filters and ended up in the cache. This commit adds the QueryWrapperFilter ctor to the forbidden APIs to enforce the query instance checks.
@jpountz @martijnvg I added two new commits see |
+1 to push |
pushed |
We have the default QueryWrapperFilter as well as our custom one while
our wrapper is explicitly marked as no_cache such that it will never
be included in a cache. This was not consistenly used and caused several
problems during tests where p/c related queries were used as filters
and ended up in the cache. This commit adds the QueryWrapperFilter
ctor to the forbidden APIs to enforce the query instance checks.
Unfortunately this doesn't fix cases where such a query is nested in a BQ or so. Yet I want to fix it step by step but this one at least fixes some cases and prevents more misuse.