-
Notifications
You must be signed in to change notification settings - Fork 149
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
fix: handle ignoreUndefinedProperties in set(merge: true) #1396
Conversation
966bf92
to
6e40aee
Compare
Codecov Report
@@ Coverage Diff @@
## master #1396 +/- ##
=======================================
Coverage 98.51% 98.51%
=======================================
Files 32 32
Lines 19374 19378 +4
Branches 1273 1360 +87
=======================================
+ Hits 19086 19090 +4
Misses 284 284
Partials 4 4
Continue to review full report at Codecov.
|
dev/src/document.ts
Outdated
// If the value is undefined it can never participate in the document | ||
// mask. With ignoreUndefinedProperties set to true, this shouldn't | ||
// affect the document mask. With ignoreUndefinedProperties set to | ||
// false, we'll throw an error when trying to create a proto from the |
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.
Nit: This error is thrown first by validateDocumentData
: "Cannot use "undefined" as a Firestore value (found in field "bar"). If you want to ignore undefined values, enable ignoreUndefinedProperties
."
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.
Fixed.
Previously any field in the document would be propagated into the DocumentMask regardless of whether or not it had an undefined value, which led to the client acting as if the user had passed `FieldValue.delete()`, which wasn't intended.
6e40aee
to
a72cc82
Compare
Previously any field in the document would be propagated into the DocumentMask regardless of whether or not it had an undefined value, which led to the client acting as if the user had passed
FieldValue.delete()
, which wasn't intended.Fixes #1392