-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Queries with null don't work as expected #704
Comments
Can confirm. Currently using null just ignores that part of the query, so for example using Is there a way we could allow null value checking and also resetting certain query properties? |
Thanks for the report. Does look like this could be fixed. Please include a minimal repro of the issue or a failing test case we can use as a marker for verifying and fixing. All issues have to follow the issue template provided, including a minimal repro or failing test case. This is critical to keep things streamlined and manageable. |
I'm very displeased such a good project managed in such bad manner lately. The error case is very simple to reproduce. I can't believe people managing the project don't have sample projects at hand to test stuff out. @katowulf I'm not planing to spare more time on this and creating a repro. So please close this (if you want) and lets keep this project buggy so that in future people can choose alternative frameworks and cloud services for their projects. |
@bogacg There are around 500 issues reported across the Firebase repositories (not counting the plethora specific to Angular projects) daily. Each takes around 15-30m to reproduce. As you can imagine, those add up, and most turn out to be red herrings. This one looks valid, as you've noted. But, just help a brother out and follow the rules by saving us some time and energy. |
@katowulf There is a Plunker that reproduces the issue here. The relevant code is in The fix would be pretty minor; all that should be required is for this line:
to be changed to:
If I have time, tomorrow, I'll submit a PR. |
Thanks. I think that the misleading method name here has probably resulted in this obscure bug. We should probably proceed as follows:
|
isPresent is a misleading name (see angular#704) as it considers options specified as null to not be present.
Values passed for equalTo, startAt and endAt should be allowed to be null. Closes angular#704.
isPresent is a misleading name (see #704) as it considers options specified as null to not be present.
This issue still persists with latest versions: |
@bogacg Indeed, it is still broken. Apparently, I missed replacing the |
i will have the issue, null here does not work
|
@leeandro0 try equalTo: undefined, this work for me. |
My quick this is shown below.
|
Version info
Angular: 2.2.3
Firebase: 3.6.1
AngularFire: 2.0.0-beta.6
How to reproduce these conditions
Stackoverflow: AngularFire2: query if child exists
Firebase Google Group: AngularFire2 query with null doesn't work
Steps to set up and reproduce Sample data and security rules
See Stackoverflow question above.
Expected behavior
Queries with given
ordeByChild: "property"
andendAt : null
is expected to filter out lists where those poperties are null/don't exist.Actual behavior
Whole list is returned with no filtering.
As @cartant pointed out, check could be done here just against
undefined
maybe and not tonull
.The text was updated successfully, but these errors were encountered: