Skip to content

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

Merged
merged 5 commits into from
Oct 15, 2018
Merged

Adding unknownDocument #1948

merged 5 commits into from
Oct 15, 2018

Conversation

schmidt-sebastian
Copy link
Contributor

Updating the iOS Proto to match Android. This is in preparation for the held write acks removal.

Copy link
Member

@rsgowman rsgowman left a 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
Copy link
Member

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?

Copy link
Contributor Author

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
Copy link
Member

Choose a reason for hiding this comment

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

s/socument/document/

Copy link
Contributor Author

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 link
Member

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'

Copy link
Contributor Author

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;
Copy link
Member

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'.

Copy link
Contributor Author

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.

Copy link
Member

@rsgowman rsgowman left a 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?

@rsgowman
Copy link
Member

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)

@schmidt-sebastian
Copy link
Contributor Author

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
Copy link
Member

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.

Copy link
Contributor Author

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
Copy link
Member

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:

  1. Nothing. If it changes, the reader will figure it out.
  2. Embed the commit hash in the url, i.e. https://github.com/googleapis/googleapis/blob/02111201c4752cdd0d7a5714ec6644f1d0297f51/google/firestore/v1beta1/firestore.proto#L734
  3. Omit "L734" and let the reader ctrl+f.

Copy link
Contributor Author

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

@schmidt-sebastian schmidt-sebastian merged commit e219c93 into master Oct 15, 2018
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt-emptydocument branch October 15, 2018 19:30
@firebase firebase locked and limited conversation to collaborators Oct 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants