-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Adding unknownDocument #1948
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
Adding unknownDocument #1948
Conversation
f572cc6
to
9feb291
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.
There's a bunch of style nits, all of which are present in the original too. If you fix them here, you should probably also fix them in the java repo.
The only one that's remotely significant is the naming, since if we fix that later, we'll have to change all the source that uses it.
@@ -20,14 +20,22 @@ message NoDocument { | |||
google.protobuf.Timestamp read_time = 2; | |||
} | |||
|
|||
// Represents either an existing document or the explicitly known absence of a | |||
// document. | |||
// Represents either an existing document, the explicitly known absence of a document, or a document |
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: Don't we line wrap to 80 chars for protos?
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 was written in Android Studio, which wraps at 100. It makes sense to limit at 80 though.
} | ||
|
||
// `hasCommittedMutations` marks documents that were written to the remote socument store based |
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.
s/socument/document/
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
} | ||
|
||
// `hasCommittedMutations` marks documents that were written to the remote socument store based | ||
// on a write acknowledgment. These documents are potentially inconsistent with the backend's |
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.
nitnitnit: double space between 'the' and 'backend'
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
// `hasCommittedMutations` marks documents that were written to the remote socument store based | ||
// on a write acknowledgment. These documents are potentially inconsistent with the backend's | ||
// copy and use the write's commit version as their document version. | ||
bool hasCommittedMutations = 4; |
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.
protos usually use snake_case for fields, i.e. 'has_committed_mutations'.
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.
Yeah, sorry - we should rename this field.
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.
Oh, also, shouldn't this PR add the UnknownDocument message too?
And while we're at it, this file is also missing a copyright header (as are the other files in this directory, though curiously not the protos in other directories.) Maybe fix that too? (Though maybe as a separate PR.) (And apologies for the repeated post-review comments) |
9958fd3
to
0b6ac70
Compare
Copyright headers added as well |
// on a write acknowledgment. These documents are potentially inconsistent with the backend's | ||
// copy and use the write's commit version as their document version. | ||
bool hasCommittedMutations = 4; | ||
// `hasCommittedMutations` marks documents that were written to the remote |
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: consider fixing the name in the comment too.
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
@@ -22,6 +36,7 @@ message Target { | |||
// The last snapshot version received from the Watch Service for this target. | |||
// | |||
// This is the same value as TargetChange.read_time | |||
// https://github.com/googleapis/googleapis/blob/master/google/firestore/v1beta1/firestore.proto#L734 |
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.
I don't much care, but this comment could go stale and end up pointing to the wrong thing if firestore.proto is changed in the future.
Solutions:
- Nothing. If it changes, the reader will figure it out.
- Embed the commit hash in the url, i.e. https://github.com/googleapis/googleapis/blob/02111201c4752cdd0d7a5714ec6644f1d0297f51/google/firestore/v1beta1/firestore.proto#L734
- Omit "L734" and let the reader ctrl+f.
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.
Leaving as is, since this URL exists in the Android repo. I wanted both files to be the same
Updating the iOS Proto to match Android. This is in preparation for the held write acks removal.