-
Notifications
You must be signed in to change notification settings - Fork 150
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
feat: use update_transform when possible #949
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3d2c595
chore: run update.sh on update_transfrom protos
6b42cd1
feat: use update_transform when possible
0b11dad
Merge branch 'master' into bc/update-integrate
977645a
remove transform
d725688
rename toProto, make document required in tester
af8f341
resolve comments: mostly code cleanup
97df00c
comments round 3: use maps and remove empty update mask from tests
2a1ca02
nit comments
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -913,6 +913,8 @@ describe('set document', () => { | |
requestEquals( | ||
request, | ||
set({ | ||
document: document('documentId'), | ||
mask: updateMask(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will break the conformance tests. We should also not set an empty update mask. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed here and in other unit tests that used an empty update mask |
||
transforms: [serverTimestamp('a'), serverTimestamp('b.c')], | ||
}) | ||
); | ||
|
@@ -941,7 +943,7 @@ describe('set document', () => { | |
transforms: [serverTimestamp('a'), serverTimestamp('b.c')], | ||
}) | ||
); | ||
return response(writeResult(2)); | ||
return response(writeResult(1)); | ||
}, | ||
}; | ||
|
||
|
@@ -1121,7 +1123,7 @@ describe('set document', () => { | |
], | ||
}) | ||
); | ||
return response(writeResult(2)); | ||
return response(writeResult(1)); | ||
}, | ||
}; | ||
|
||
|
@@ -1354,6 +1356,7 @@ describe('create document', () => { | |
requestEquals( | ||
request, | ||
create({ | ||
document: document('documentId'), | ||
transforms: [ | ||
serverTimestamp('field'), | ||
serverTimestamp('map.field'), | ||
|
@@ -1458,7 +1461,7 @@ describe('update document', () => { | |
mask: updateMask('a', 'foo'), | ||
}) | ||
); | ||
return response(writeResult(2)); | ||
return response(writeResult(1)); | ||
}, | ||
}; | ||
|
||
|
@@ -1474,7 +1477,13 @@ describe('update document', () => { | |
it('skips write for single field transform', () => { | ||
const overrides: ApiOverride = { | ||
commit: request => { | ||
requestEquals(request, update({transforms: [serverTimestamp('a')]})); | ||
requestEquals( | ||
request, | ||
update({ | ||
document: document('documentId'), | ||
transforms: [serverTimestamp('a')], | ||
}) | ||
); | ||
return response(writeResult(1)); | ||
}, | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Optional: Use
map
to turn this function into one line.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.
attempted, but used
Array.from()