Skip to content

Commit f39cdf3

Browse files
authored
Port DocumentState and UnknownDocument. (#2160)
Part of heldwriteacks. Serialization work for this is largely deferred until after nanopb-master is merged with master.
1 parent 5063e9f commit f39cdf3

File tree

19 files changed

+230
-145
lines changed

19 files changed

+230
-145
lines changed

Firestore/Example/Firestore.xcodeproj/project.pbxproj

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@
187187
AB380D04201BC6E400D97691 /* ordered_code_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB380D03201BC6E400D97691 /* ordered_code_test.cc */; };
188188
AB38D93020236E21000A432D /* database_info_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB38D92E20235D22000A432D /* database_info_test.cc */; };
189189
AB6B908420322E4D00CC290A /* document_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB6B908320322E4D00CC290A /* document_test.cc */; };
190-
AB6B908620322E6D00CC290A /* maybe_document_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB6B908520322E6D00CC290A /* maybe_document_test.cc */; };
191190
AB6B908820322E8800CC290A /* no_document_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB6B908720322E8800CC290A /* no_document_test.cc */; };
192191
AB7BAB342012B519001E0872 /* geo_point_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB7BAB332012B519001E0872 /* geo_point_test.cc */; };
193192
ABA495BB202B7E80008A7851 /* snapshot_version_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = ABA495B9202B7E79008A7851 /* snapshot_version_test.cc */; };
@@ -203,7 +202,6 @@
203202
B65D34A9203C995B0076A5E1 /* FIRTimestampTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B65D34A7203C99090076A5E1 /* FIRTimestampTest.m */; };
204203
B66D8996213609EE0086DA0C /* stream_test.mm in Sources */ = {isa = PBXBuildFile; fileRef = B66D8995213609EE0086DA0C /* stream_test.mm */; };
205204
B67BF449216EB43000CA9097 /* create_noop_connectivity_monitor.cc in Sources */ = {isa = PBXBuildFile; fileRef = B67BF448216EB43000CA9097 /* create_noop_connectivity_monitor.cc */; };
206-
B67BF44A216EB43000CA9097 /* create_noop_connectivity_monitor.cc in Sources */ = {isa = PBXBuildFile; fileRef = B67BF448216EB43000CA9097 /* create_noop_connectivity_monitor.cc */; };
207205
B686F2AF2023DDEE0028D6BE /* field_path_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B686F2AD2023DDB20028D6BE /* field_path_test.cc */; };
208206
B686F2B22025000D0028D6BE /* resource_path_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B686F2B02024FFD70028D6BE /* resource_path_test.cc */; };
209207
B6BBE43121262CF400C6A53E /* grpc_stream_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B6BBE42F21262CF400C6A53E /* grpc_stream_test.cc */; };
@@ -505,7 +503,6 @@
505503
AB38D9342023966E000A432D /* credentials_provider_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = credentials_provider_test.cc; sourceTree = "<group>"; };
506504
AB38D93620239689000A432D /* empty_credentials_provider_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = empty_credentials_provider_test.cc; sourceTree = "<group>"; };
507505
AB6B908320322E4D00CC290A /* document_test.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = document_test.cc; sourceTree = "<group>"; };
508-
AB6B908520322E6D00CC290A /* maybe_document_test.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = maybe_document_test.cc; sourceTree = "<group>"; };
509506
AB6B908720322E8800CC290A /* no_document_test.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = no_document_test.cc; sourceTree = "<group>"; };
510507
AB71064B201FA60300344F18 /* database_id_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = database_id_test.cc; sourceTree = "<group>"; };
511508
AB7BAB332012B519001E0872 /* geo_point_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = geo_point_test.cc; sourceTree = "<group>"; };
@@ -665,12 +662,12 @@
665662
546854A720A3681B004BDBD5 /* remote */ = {
666663
isa = PBXGroup;
667664
children = (
668-
B6D964942163E63900EB9CFB /* grpc_unary_call_test.cc */,
669-
B6D9649021544D4F00EB9CFB /* grpc_connection_test.cc */,
670-
B6D964922154AB8F00EB9CFB /* grpc_streaming_reader_test.cc */,
671665
546854A820A36867004BDBD5 /* datastore_test.mm */,
672666
B6D1B68420E2AB1A00B35856 /* exponential_backoff_test.cc */,
667+
B6D9649021544D4F00EB9CFB /* grpc_connection_test.cc */,
673668
B6BBE42F21262CF400C6A53E /* grpc_stream_test.cc */,
669+
B6D964922154AB8F00EB9CFB /* grpc_streaming_reader_test.cc */,
670+
B6D964942163E63900EB9CFB /* grpc_unary_call_test.cc */,
674671
61F72C5520BC48FD001A68CB /* serializer_test.cc */,
675672
B66D8995213609EE0086DA0C /* stream_test.mm */,
676673
);
@@ -680,10 +677,6 @@
680677
54740A561FC913EB00713A1A /* util */ = {
681678
isa = PBXGroup;
682679
children = (
683-
B60894F62170207100EBC644 /* fake_credentials_provider.cc */,
684-
B60894F52170207100EBC644 /* fake_credentials_provider.h */,
685-
B67BF448216EB43000CA9097 /* create_noop_connectivity_monitor.cc */,
686-
B67BF447216EB42F00CA9097 /* create_noop_connectivity_monitor.h */,
687680
B6FB4680208EA0BE00554BA2 /* async_queue_libdispatch_test.mm */,
688681
B6FB4681208EA0BE00554BA2 /* async_queue_std_test.cc */,
689682
B6FB467B208E9A8200554BA2 /* async_queue_test.cc */,
@@ -692,10 +685,14 @@
692685
54740A521FC913E500713A1A /* autoid_test.cc */,
693686
AB380D01201BC69F00D97691 /* bits_test.cc */,
694687
548DB928200D59F600E00ABC /* comparison_test.cc */,
688+
B67BF448216EB43000CA9097 /* create_noop_connectivity_monitor.cc */,
689+
B67BF447216EB42F00CA9097 /* create_noop_connectivity_monitor.h */,
695690
B6FB4689208F9B9100554BA2 /* executor_libdispatch_test.mm */,
696691
B6FB4687208F9B9100554BA2 /* executor_std_test.cc */,
697692
B6FB4688208F9B9100554BA2 /* executor_test.cc */,
698693
B6FB468A208F9B9100554BA2 /* executor_test.h */,
694+
B60894F62170207100EBC644 /* fake_credentials_provider.cc */,
695+
B60894F52170207100EBC644 /* fake_credentials_provider.h */,
699696
F51859B394D01C0C507282F1 /* filesystem_test.cc */,
700697
B1A7E1959AF8141FA7E6B888 /* grpc_stream_tester.cc */,
701698
ED4B3E3EA0EBF3ED19A07060 /* grpc_stream_tester.h */,
@@ -1044,7 +1041,6 @@
10441041
549CCA5320A36E1F00BCEB75 /* field_mask_test.cc */,
10451042
B686F2AD2023DDB20028D6BE /* field_path_test.cc */,
10461043
AB356EF6200EA5EB0089B766 /* field_value_test.cc */,
1047-
AB6B908520322E6D00CC290A /* maybe_document_test.cc */,
10481044
C8522DE226C467C54E6788D8 /* mutation_test.cc */,
10491045
AB6B908720322E8800CC290A /* no_document_test.cc */,
10501046
549CCA5520A36E1F00BCEB75 /* precondition_test.cc */,
@@ -1870,7 +1866,6 @@
18701866
5467FB01203E5717009C9584 /* FIRFirestoreTests.mm in Sources */,
18711867
5492E052202154AB00B64F25 /* FIRGeoPointTests.mm in Sources */,
18721868
5492E059202154AB00B64F25 /* FIRQuerySnapshotTests.mm in Sources */,
1873-
B60894F72170207200EBC644 /* fake_credentials_provider.cc in Sources */,
18741869
5492E051202154AA00B64F25 /* FIRQueryTests.mm in Sources */,
18751870
5492E057202154AB00B64F25 /* FIRSnapshotMetadataTests.mm in Sources */,
18761871
B65D34A9203C995B0076A5E1 /* FIRTimestampTest.m in Sources */,
@@ -1905,7 +1900,6 @@
19051900
5492E0A42021552D00B64F25 /* FSTMemoryQueryCacheTests.mm in Sources */,
19061901
5492E0A52021552D00B64F25 /* FSTMemoryRemoteDocumentCacheTests.mm in Sources */,
19071902
5492E03420213FFC00B64F25 /* FSTMemorySpecTests.mm in Sources */,
1908-
B6D964952163E63900EB9CFB /* grpc_unary_call_test.cc in Sources */,
19091903
5492E03220213FFC00B64F25 /* FSTMockDatastore.mm in Sources */,
19101904
5492E0AC2021552D00B64F25 /* FSTMutationQueueTests.mm in Sources */,
19111905
5492E0BE2021555100B64F25 /* FSTMutationTests.mm in Sources */,
@@ -1935,6 +1929,7 @@
19351929
AB380D02201BC69F00D97691 /* bits_test.cc in Sources */,
19361930
618BBEA920B89AAC00B5BCE7 /* common.pb.cc in Sources */,
19371931
548DB929200D59F600E00ABC /* comparison_test.cc in Sources */,
1932+
B67BF449216EB43000CA9097 /* create_noop_connectivity_monitor.cc in Sources */,
19381933
ABC1D7DC2023A04B00BA84F0 /* credentials_provider_test.cc in Sources */,
19391934
ABE6637A201FA81900ED349A /* database_id_test.cc in Sources */,
19401935
AB38D93020236E21000A432D /* database_info_test.cc in Sources */,
@@ -1947,6 +1942,7 @@
19471942
B6FB468F208F9BAE00554BA2 /* executor_std_test.cc in Sources */,
19481943
B6FB4690208F9BB300554BA2 /* executor_test.cc in Sources */,
19491944
B6D1B68520E2AB1B00B35856 /* exponential_backoff_test.cc in Sources */,
1945+
B60894F72170207200EBC644 /* fake_credentials_provider.cc in Sources */,
19501946
549CCA5720A36E1F00BCEB75 /* field_mask_test.cc in Sources */,
19511947
B686F2AF2023DDEE0028D6BE /* field_path_test.cc in Sources */,
19521948
54A0352620A3AED0003E0143 /* field_transform_test.mm in Sources */,
@@ -1955,9 +1951,11 @@
19551951
ABC1D7E42024AFDE00BA84F0 /* firebase_credentials_provider_test.mm in Sources */,
19561952
618BBEAA20B89AAC00B5BCE7 /* firestore.pb.cc in Sources */,
19571953
AB7BAB342012B519001E0872 /* geo_point_test.cc in Sources */,
1954+
B6D9649121544D4F00EB9CFB /* grpc_connection_test.cc in Sources */,
19581955
B6BBE43121262CF400C6A53E /* grpc_stream_test.cc in Sources */,
19591956
333FCB7BB0C9986B5DF28FC8 /* grpc_stream_tester.cc in Sources */,
19601957
B6D964932154AB8F00EB9CFB /* grpc_streaming_reader_test.cc in Sources */,
1958+
B6D964952163E63900EB9CFB /* grpc_unary_call_test.cc in Sources */,
19611959
73FE5066020EF9B2892C86BF /* hard_assert_test.cc in Sources */,
19621960
54511E8E209805F8005BD28F /* hashing_test.cc in Sources */,
19631961
618BBEB020B89AAC00B5BCE7 /* http.pb.cc in Sources */,
@@ -1968,7 +1966,6 @@
19681966
020AFD89BB40E5175838BB76 /* local_serializer_test.cc in Sources */,
19691967
54C2294F1FECABAE007D065B /* log_test.cc in Sources */,
19701968
618BBEA720B89AAC00B5BCE7 /* maybe_document.pb.cc in Sources */,
1971-
AB6B908620322E6D00CC290A /* maybe_document_test.cc in Sources */,
19721969
618BBEA820B89AAC00B5BCE7 /* mutation.pb.cc in Sources */,
19731970
32F022CB75AEE48CDDAF2982 /* mutation_test.cc in Sources */,
19741971
84DBE646DCB49305879D3500 /* nanopb_string_test.cc in Sources */,
@@ -2001,9 +1998,7 @@
20011998
ABC1D7E12023A40C00BA84F0 /* token_test.cc in Sources */,
20021999
54A0352720A3AED0003E0143 /* transform_operations_test.mm in Sources */,
20032000
549CCA5120A36DBC00BCEB75 /* tree_sorted_map_test.cc in Sources */,
2004-
B6D9649121544D4F00EB9CFB /* grpc_connection_test.cc in Sources */,
20052001
C80B10E79CDD7EF7843C321E /* type_traits_apple_test.mm in Sources */,
2006-
B67BF449216EB43000CA9097 /* create_noop_connectivity_monitor.cc in Sources */,
20072002
ABC1D7DE2023A05300BA84F0 /* user_test.cc in Sources */,
20082003
618BBEAD20B89AAC00B5BCE7 /* write.pb.cc in Sources */,
20092004
);
@@ -2041,7 +2036,6 @@
20412036
5492E080202154EC00B64F25 /* FSTSmokeTests.mm in Sources */,
20422037
5492E07F202154EC00B64F25 /* FSTTransactionTests.mm in Sources */,
20432038
5492E0442021457E00B64F25 /* XCTestCase+Await.mm in Sources */,
2044-
B67BF44A216EB43000CA9097 /* create_noop_connectivity_monitor.cc in Sources */,
20452039
EBFC611B1BF195D0EC710AF4 /* app_testing.mm in Sources */,
20462040
CA989C0E6020C372A62B7062 /* testutil.cc in Sources */,
20472041
);

Firestore/core/src/firebase/firestore/local/local_serializer.cc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,12 @@ void LocalSerializer::EncodeMaybeDocument(
6464
});
6565
return;
6666

67+
case MaybeDocument::Type::UnknownDocument:
68+
// TODO(rsgowman): Implement
69+
abort();
70+
6771
case MaybeDocument::Type::Unknown:
68-
// TODO(rsgowman)
72+
// TODO(rsgowman): Error handling
6973
abort();
7074
}
7175

@@ -168,8 +172,12 @@ std::unique_ptr<NoDocument> LocalSerializer::DecodeNoDocument(
168172
}
169173

170174
if (!reader->status().ok()) return nullptr;
175+
// TODO(rsgowman): Fix hardcoding of has_committed_mutations.
176+
// Instead, we should grab this from the proto (see other ports). However,
177+
// we'll defer until the nanopb-master gets merged to master.
171178
return absl::make_unique<NoDocument>(rpc_serializer_.DecodeKey(name),
172-
*std::move(version));
179+
*std::move(version),
180+
/*has_committed_mutations=*/false);
173181
}
174182

175183
void LocalSerializer::EncodeQueryData(Writer* writer,

Firestore/core/src/firebase/firestore/model/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ cc_library(
4343
snapshot_version.h
4444
transform_operations.h
4545
types.h
46+
unknown_document.cc
47+
unknown_document.h
4648
DEPENDS
4749
absl_optional
4850
absl_strings

Firestore/core/src/firebase/firestore/model/document.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ namespace model {
2727
Document::Document(FieldValue&& data,
2828
DocumentKey key,
2929
SnapshotVersion version,
30-
bool has_local_mutations)
30+
DocumentState document_state)
3131
: MaybeDocument(std::move(key), std::move(version)),
3232
data_(std::move(data)),
33-
has_local_mutations_(has_local_mutations) {
33+
document_state_(document_state) {
3434
set_type(Type::Document);
3535
HARD_ASSERT(FieldValue::Type::Object == data.type());
3636
}
@@ -41,7 +41,7 @@ bool Document::Equals(const MaybeDocument& other) const {
4141
}
4242
auto& other_doc = static_cast<const Document&>(other);
4343
return MaybeDocument::Equals(other) &&
44-
has_local_mutations_ == other_doc.has_local_mutations_ &&
44+
document_state_ == other_doc.document_state_ &&
4545
data_ == other_doc.data_;
4646
}
4747

Firestore/core/src/firebase/firestore/model/document.h

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,23 @@ namespace firebase {
2626
namespace firestore {
2727
namespace model {
2828

29+
enum class DocumentState {
30+
/**
31+
* Local mutations applied via the mutation queue. Document is potentially
32+
* inconsistent.
33+
*/
34+
kLocalMutations,
35+
36+
/**
37+
* Mutations applied based on a write acknowledgment. Document is potentially
38+
* inconsistent.
39+
*/
40+
kCommittedMutations,
41+
42+
/** No mutations applied. Document was sent to us by Watch. */
43+
kSynced,
44+
};
45+
2946
/**
3047
* Represents a document in Firestore with a key, version, data and whether the
3148
* data has local mutations applied to it.
@@ -38,7 +55,7 @@ class Document : public MaybeDocument {
3855
Document(FieldValue&& data,
3956
DocumentKey key,
4057
SnapshotVersion version,
41-
bool has_local_mutations);
58+
DocumentState document_state);
4259

4360
const FieldValue& data() const {
4461
return data_;
@@ -48,22 +65,30 @@ class Document : public MaybeDocument {
4865
return data_.Get(path);
4966
}
5067

51-
bool has_local_mutations() const {
52-
return has_local_mutations_;
68+
bool HasLocalMutations() const {
69+
return document_state_ == DocumentState::kLocalMutations;
70+
}
71+
72+
bool HasCommittedMutations() const {
73+
return document_state_ == DocumentState::kCommittedMutations;
74+
}
75+
76+
bool HasPendingWrites() const override {
77+
return HasLocalMutations() || HasCommittedMutations();
5378
}
5479

5580
protected:
5681
bool Equals(const MaybeDocument& other) const override;
5782

5883
private:
5984
FieldValue data_; // This is of type Object.
60-
bool has_local_mutations_;
85+
DocumentState document_state_;
6186
};
6287

6388
/** Compares against another Document. */
6489
inline bool operator==(const Document& lhs, const Document& rhs) {
6590
return lhs.version() == rhs.version() && lhs.key() == rhs.key() &&
66-
lhs.has_local_mutations() == rhs.has_local_mutations() &&
91+
lhs.HasLocalMutations() == rhs.HasLocalMutations() &&
6792
lhs.data() == rhs.data();
6893
}
6994

Firestore/core/src/firebase/firestore/model/maybe_document.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,20 @@ class MaybeDocument {
3535
public:
3636
/**
3737
* All the different kinds of documents, including MaybeDocument and its
38-
* subclasses. This is used to provide RTTI for documents.
38+
* subclasses. This is used to provide RTTI for documents. See the docstrings
39+
* of the subclasses for details.
3940
*/
4041
enum class Type {
42+
// An unknown subclass of MaybeDocument. This should never happen.
43+
//
44+
// TODO(rsgowman): Since it's no longer possible to directly create
45+
// MaybeDocument's, we can likely remove this value entirely. But
46+
// investigate impact on the serializers first.
4147
Unknown,
48+
4249
Document,
4350
NoDocument,
51+
UnknownDocument,
4452
};
4553

4654
MaybeDocument(DocumentKey key, SnapshotVersion version);
@@ -66,6 +74,12 @@ class MaybeDocument {
6674
return version_;
6775
}
6876

77+
/**
78+
* Whether this document has a local mutation applied that has not yet been
79+
* acknowledged by Watch.
80+
*/
81+
virtual bool HasPendingWrites() const = 0;
82+
6983
protected:
7084
// Only allow subclass to set their types.
7185
void set_type(Type type) {

Firestore/core/src/firebase/firestore/model/mutation.cc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ std::shared_ptr<const MaybeDocument> SetMutation::ApplyToLocalView(
6565

6666
SnapshotVersion version = GetPostMutationVersion(maybe_doc.get());
6767
return absl::make_unique<Document>(FieldValue(value_), key(), version,
68-
/*has_local_mutations=*/true);
68+
DocumentState::kLocalMutations);
6969
}
7070

7171
PatchMutation::PatchMutation(DocumentKey&& key,
@@ -84,17 +84,13 @@ std::shared_ptr<const MaybeDocument> PatchMutation::ApplyToLocalView(
8484
VerifyKeyMatches(maybe_doc.get());
8585

8686
if (!precondition().IsValidFor(maybe_doc.get())) {
87-
if (maybe_doc) {
88-
return absl::make_unique<MaybeDocument>(maybe_doc->key(),
89-
maybe_doc->version());
90-
}
91-
return nullptr;
87+
return maybe_doc;
9288
}
9389

9490
SnapshotVersion version = GetPostMutationVersion(maybe_doc.get());
9591
FieldValue new_data = PatchDocument(maybe_doc.get());
9692
return absl::make_unique<Document>(std::move(new_data), key(), version,
97-
/*has_local_mutations=*/true);
93+
DocumentState::kLocalMutations);
9894
}
9995

10096
FieldValue PatchMutation::PatchDocument(const MaybeDocument* maybe_doc) const {

Firestore/core/src/firebase/firestore/model/no_document.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ namespace firebase {
2222
namespace firestore {
2323
namespace model {
2424

25-
NoDocument::NoDocument(DocumentKey key, SnapshotVersion version)
26-
: MaybeDocument(std::move(key), std::move(version)) {
25+
NoDocument::NoDocument(DocumentKey key,
26+
SnapshotVersion version,
27+
bool has_committed_mutations)
28+
: MaybeDocument(std::move(key), std::move(version)),
29+
has_committed_mutations_(has_committed_mutations) {
2730
set_type(Type::NoDocument);
2831
}
2932

Firestore/core/src/firebase/firestore/model/no_document.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,16 @@ namespace model {
2626
/** Represents that no documents exists for the key at the given version. */
2727
class NoDocument : public MaybeDocument {
2828
public:
29-
NoDocument(DocumentKey key, SnapshotVersion version);
29+
NoDocument(DocumentKey key,
30+
SnapshotVersion version,
31+
bool has_committed_mutations);
32+
33+
bool HasPendingWrites() const override {
34+
return has_committed_mutations_;
35+
}
36+
37+
private:
38+
bool has_committed_mutations_;
3039
};
3140

3241
} // namespace model
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright 2018 Google
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#include "Firestore/core/src/firebase/firestore/model/unknown_document.h"
18+
19+
#include <utility>
20+
21+
namespace firebase {
22+
namespace firestore {
23+
namespace model {
24+
25+
UnknownDocument::UnknownDocument(DocumentKey key, SnapshotVersion version)
26+
: MaybeDocument(std::move(key), std::move(version)) {
27+
set_type(Type::UnknownDocument);
28+
}
29+
30+
} // namespace model
31+
} // namespace firestore
32+
} // namespace firebase

0 commit comments

Comments
 (0)