-
Notifications
You must be signed in to change notification settings - Fork 897
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
Remove null and NaN checks in filters #3960
Conversation
🦋 Changeset detectedLatest commit: efd4ed1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Binary Size ReportAffected SDKs
Test Logs |
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
.changeset/wicked-cups-search.md
Outdated
'@firebase/firestore': minor | ||
--- | ||
|
||
Removed validation of `null` and `NaN` values in filters. However, note that only `==` and `!=` filters match against `null` and `NaN`. |
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.
However, note that only
==
and!=
filters match againstnull
andNaN
.
This reads to me in a way that suggests we're removing guard rails but still expecting users to remember this. I'd suggest something more like this:
Removed excess validation of
null
andNaN
values in query filters. This more closely aligns the SDK with the Firestore backend, which has always acceptednull
andNaN
for all operators, even though this isn't necessarily useful.
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.
done.
@@ -800,6 +813,14 @@ apiDescribe('Queries', (persistence: boolean) => { | |||
// With objects. | |||
const snapshot2 = await coll.where('zip', 'in', [{ code: 500 }]).get(); | |||
expect(toDataArray(snapshot2)).to.deep.equal([{ zip: { code: 500 } }]); | |||
|
|||
// With null. | |||
const snapshot3 = await coll.where('zip', 'in', [null]).get(); |
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 a test that shows that "in" with null/nan and something else still finds the something else?
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.
done.
|
||
// With null. | ||
const snapshot3 = await coll | ||
.where('zip', 'array-contains-any', [null]) |
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 a test that shows that "array-contains-any" with null/nan and something else still finds the something else?
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.
done.
No description provided.