Skip to content

Commit e219c93

Browse files
Adding unknownDocument (#1948)
1 parent 1b400ff commit e219c93

File tree

3 files changed

+67
-2
lines changed

3 files changed

+67
-2
lines changed

Firestore/Protos/protos/firestore/local/maybe_document.proto

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2018 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
syntax = "proto3";
216

317
package firestore.client;
@@ -20,14 +34,35 @@ message NoDocument {
2034
google.protobuf.Timestamp read_time = 2;
2135
}
2236

23-
// Represents either an existing document or the explicitly known absence of a
24-
// document.
37+
// A message indicating that the document that is known to exist but its data
38+
// is unknown.
39+
message UnknownDocument {
40+
// The name of the document that is known to exist, in the standard format:
41+
// `projects/{project_id}/databases/{database_id}/documents/{document_path}`
42+
string name = 1;
43+
44+
// The version at which we know the document exists.
45+
google.protobuf.Timestamp version = 2;
46+
}
47+
48+
// Represents either an existing document, the explicitly known absence of a
49+
// document, or a document that is known to exist (at some version) but whose
50+
// contents are unknown.
2551
message MaybeDocument {
2652
oneof document_type {
2753
// Used if the document is known to not exist.
2854
NoDocument no_document = 1;
2955

3056
// The document (if it exists).
3157
google.firestore.v1beta1.Document document = 2;
58+
59+
// Used if the document is known to exist but its data is unknown.
60+
UnknownDocument unknown_document = 3;
3261
}
62+
63+
// `has_committed_mutations` marks documents that were written to the remote
64+
// document store based on a write acknowledgment. These documents are
65+
// potentially inconsistent with the backend's copy and use the write's
66+
// commit version as their document version.
67+
bool has_committed_mutations = 4;
3368
}

Firestore/Protos/protos/firestore/local/mutation.proto

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2018 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
syntax = "proto3";
216

317
import "google/firestore/v1beta1/write.proto";

Firestore/Protos/protos/firestore/local/target.proto

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2018 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
syntax = "proto3";
216

317
package firestore.client;
@@ -22,6 +36,7 @@ message Target {
2236
// The last snapshot version received from the Watch Service for this target.
2337
//
2438
// This is the same value as TargetChange.read_time
39+
// https://github.com/googleapis/googleapis/blob/master/google/firestore/v1beta1/firestore.proto#L734
2540
google.protobuf.Timestamp snapshot_version = 2;
2641

2742
// An opaque, server-assigned token that allows watching a query to be
@@ -38,6 +53,7 @@ message Target {
3853
// the client should use the snapshot_version for its own purposes.
3954
//
4055
// This is the same value as TargetChange.resume_token
56+
// https://github.com/googleapis/googleapis/blob/master/google/firestore/v1beta1/firestore.proto#L722
4157
bytes resume_token = 3;
4258

4359
// A sequence number representing the last time this query was listened to,

0 commit comments

Comments
 (0)