-
Notifications
You must be signed in to change notification settings - Fork 152
Skipping empty write requests #74
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
Codecov Report
@@ Coverage Diff @@
## master #74 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 12 12
Lines 1547 1596 +49
=====================================
+ Hits 1547 1596 +49
Continue to review full report at Codecov.
|
0712124
to
c05cb11
Compare
ea9fad9
to
e6c41fc
Compare
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.
This is a lot of code churn for slightly questionable benefit, but I guess it's worth it to increase our test coverage... in that name though, I'm going slightly light on code review and trusting that our tests are covering this code sufficiently well. I did flag a few things though.
conformance/runner.js
Outdated
resolve(); | ||
try { | ||
assert.deepEqual(request, expected); | ||
resolve(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/document.js
Outdated
* turns { foo.bar : foobar } into { foo { bar : foobar }} | ||
* | ||
* @private | ||
* @param {firestore/DocumentReference} ref - The reference to the documen.t |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/document.js
Outdated
return true; | ||
} | ||
|
||
return isEmptyObject(this._fieldsProto); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/write-batch.js
Outdated
); | ||
|
||
if (explicitTransaction) { | ||
request.transaction = explicitTransaction; | ||
} | ||
|
||
// We store the number of operations that we sent as part of this commit | ||
// as the user is able to add additional operations afterwards. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Addressed comments. I agree that this PR brings very little benefit to Node, but I think the benefit that it brings to the GCloud SDKs as a whole far outweighs the work that has gone into this. |
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.
Couple minor requests, but overall looks good. Thanks!
src/write-batch.js
Outdated
// We store the number of operations that we sent as part of this commit | ||
// as the user is able to add additional operations afterwards. | ||
let opCount = this._writes.length; | ||
this._committed = true; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -294,6 +294,21 @@ describe('batch support', function() { | |||
}); | |||
}); | |||
|
|||
it('cannot append to committed batch', function() { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
…s/nodejs-firestore into mrschmidt-onetimestamp
This is required for a full pass of the conformance test.
This adds fromObject and fromUpdateMap to DocumentTransform, DocumentMask, and DocumentSnapshot and moves some of the existing logic to expand objects into these functions.
This also adds the ability to delete nested fields via merge. set({a : { b: delete}}, merge) was previously not supported, but I needed it for the system test.