Skip to content

Return latest write result#777

Merged
jdpedrie merged 2 commits intogoogleapis:masterfrom
jdpedrie:firestore-write-result
Dec 11, 2017
Merged

Return latest write result#777
jdpedrie merged 2 commits intogoogleapis:masterfrom
jdpedrie:firestore-write-result

Conversation

@jdpedrie
Copy link
Copy Markdown
Contributor

@jdpedrie jdpedrie commented Dec 6, 2017

This change modifies the return value of mutation calls on DocumentReference. If multiple write results are found, the latest is now returned rather than the first. This is to better conform with the Firestore implementation guide, which states as follows:

A single call to update() might return either one or two WriteResults (if there are DocumentTransforms). Since this generates an unexpected response, we should return only the latest of the WriteResults.

This change is not breaking.

@jdpedrie jdpedrie added the api: firestore Issues related to the Firestore API. label Dec 6, 2017
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 6, 2017
Copy link
Copy Markdown
Contributor

@dwsupplee dwsupplee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docblock for writeResult should be updated, otherwise LGTM

@jdpedrie
Copy link
Copy Markdown
Contributor Author

thanks @dwsupplee. done.

@jdpedrie jdpedrie merged commit 5abb1f0 into googleapis:master Dec 11, 2017
@jdpedrie jdpedrie deleted the firestore-write-result branch December 11, 2017 20:05
@jdpedrie jdpedrie mentioned this pull request Dec 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: firestore Issues related to the Firestore API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants