-
-
Notifications
You must be signed in to change notification settings - Fork 164
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
request params with a key but no value should be considered unset #1676
Conversation
As far as i understand this change: This would make results less arbitrary in regard to "weird" venues / other places because of the placeholder bypass mentioned by @Joxit . München without &categories and München with &categories is an even better case then Paris. so basically a very good thing for small /easy requests. But wouldn't this make the categorie attribute in the resultset redundant / only useful to differentiate the requested categories... unless the categorie attribute is always part of the result, if available, regardless of the request parameter? Wouldn't this be non-breaking since it is an addition? we actually use @arnesetzer: We should at least be aware of this change and react accordingly in our setup |
I'm not sure I fully understand, but I'm interested to hear your feedback before merging. For clarification, the intended change of behavior is:
|
I think this a bug fix, when the original predicate logic was written we didn't have the concept of an 'empty parameter' (ie. a query parameter with a key but no value). |
Then I misunderstood the implication of this change based on this line. What i understood was that non-empty values for the categories-param wouldn't go through anymore and therefore changing the behaviour entirely. (My bad for not looking more into the actually change in code)
These two points were what i was worried about changing. But since this isn't the case, the bugfix is more then welcome (see my München example) |
I did some tests and it seems that
At work, I'm moving my clients from |
I've put it up on
I'm not sure I fully understand the change to
While it's true that the functionality will change, the categories feature is still undocumented (something I'm trying to get fixed, by working through the remaining issues!). In particular the behaviour of categories with an empty param was never well defined, I understand both the commenters in this thread rely on the existing behaviour but isn't it a welcome improvement?
I played with the compare tool and I don't think this is the case?
Honestly I didn't think supporting a valueless param would have this many footguns, but I still prefer it to having a 'special string'. |
One thing to clarify is that there are essentially two discrete codepaths operating on the
|
Regarding the I set my browser to French and then tried both note: I had to keep my console open and |
1715f8b
to
e0326c7
Compare
For the lang parameter, what I meant is the |
Oh yes you're right, with the change it will no longer bypass the use of placeholder
What about a parameter to control categories, meta, addendum and hierarchy display ? |
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.
LGTM
@CeallachKN / @arnesetzer do you have any concerns with merging this? |
Regarding #1405 (comment) this PR changes the behaviour of the
hasRequestParameter
predicate.Prior to this change it would return
true
when a query param key existed regardless of the value.This PR modifies this behaviour so that the value must also be non-empty.
note: I believe the only place this has any consequence is for
?categories
as it's the only 'empty param' we currently support.I'm not sure why the tests cover
Number
andObject
, but I just maintained what we currently had 🤷♂️ .