Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

s1monw
Copy link
Contributor

@s1monw s1monw commented Mar 14, 2014

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.

return new QueryWrapperFilter(query);
}
}
}
Copy link
Contributor

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?

Copy link
Contributor Author

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!

@martijnvg
Copy link
Member

+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.
@s1monw
Copy link
Contributor Author

s1monw commented Mar 14, 2014

@jpountz @martijnvg I added two new commits see Explain why Factory is used and Improve resource handling in Parent/ChildQuery

@jpountz
Copy link
Contributor

jpountz commented Mar 14, 2014

+1 to push

@s1monw
Copy link
Contributor Author

s1monw commented Mar 14, 2014

pushed

@s1monw s1monw closed this Mar 14, 2014
@s1monw s1monw deleted the wrap_query branch March 14, 2014 19:25
@clintongormley clintongormley added :Core/Infra/Transport API Transport client API and removed >enhancement labels Jun 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants