-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Add Allows filter to bypass DefaultQueryFilters #18192
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
Conversation
@@ -2232,6 +2232,10 @@ mod tests { | |||
let mut query = QueryState::<Has<C>>::new(&mut world); | |||
assert_eq!(3, query.iter(&world).count()); | |||
|
|||
// Allows should bypass the filter entirely |
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.
Is it possible to write or update a test or example explaining why allows is different than has?
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.
Could use an example, but I think the implementation is good!
I don't think this use of "archetypal" access matches the original intent. (Although I don't know whether anyone is actually using it for its original purpose!) From #11700,
I'd gently vote for making this a new kind of access. If we do want to use "archetypal" for this, then we should probably update the doc comment to say something other than "whose presence in an archetype may affect query results". |
I'm sympathetic to this, but I'm reluctant to block this particular PR over it, or to add more complexity for a very niche feature currently. |
Objective
Fixes #17803
Solution
Allows<T>
QueryFilter
that adds archetypal access forT
Testing
DefaultQueryFilters