Skip to content

Commit 7c1d0b7

Browse files
var-consta-maurice
authored andcommitted
Import Firestore release 1.15.0 from GitHub (Firebase 6.26.0, M72).
The only manual changes are to: - rename references to members of the `Error` enum (e.g. s/Error::kOk/Error::kErrorOk); - revert the google3-internal change to `exception.cc` being overwritten (see cr/295257418). Copybara-generated description follows: Import of Firestore from GitHub. - 17746dd3a0afa5781e1d401b54d94225d0bc7061 Update CHANGELOG for Firestore v1.15.0 (#5688) by Gil <mcg@google.com> - f83f3418db7bfa16a85cdc494ea17b0f22811125 Avoid destroying the Task's operation while holding a loc... by Gil <mcg@google.com> - 0cf5999e424e4c29585cad9088d3259244a97d4d Update comment for addSnapshotsInSyncListener (#5660) by Brian Chen <chenbrian@google.com> - d935e849472a302faad7168c6332ff3feaf1f6dc Make RemoveSnapshotsInSyncListener run on the async queue... by Gil <mcg@google.com> - 5f5b65a539404687433848af65ff0ec8183ad3c0 Avoid blocking access to the AsyncQueue during Dispose (#... by Gil <mcg@google.com> - 8ef8b3040dc4a370305f844636ac63b7e1d9d456 Implement safe, synchronous destruction in Firestore (#56... by Gil <mcg@google.com> - e462d04ddb03d4f76768b85a1168fcfa46d92573 Make Executors have deterministic shutdown (#5547) by Gil <mcg@google.com> - 819091b289b48ac111008f0950853fd7bb54a521 Fix Windows and Fuzzing builds (#5616) by Gil <mcg@google.com> - 755410f937214c5fd33801fca4e303d3c59c26af Bump stream closing log to WARN. (#5604) by wu-hui <53845758+wu-hui@users.noreply.github.com> - 7f9d28f7af2ddc057b61ba7d53f1392c9b82d043 Make sure `timestamp.h` compiles even in presence of `min... by Konstantin Varlamov <var-const@users.noreply.github.com> - b57f8b2ce64d2f2cb36fab3150fec99f6ab1d385 Add defer, a general facility for ad-hoc RAII. (#5554) by Gil <mcg@google.com> - a3d8377c7a293d6e2dd7635eef353eaa79e2be4d Update CHANGELOG for Firestore v1.14.0 (#5601) by Gil <mcg@google.com> - 287224cdf417a61d1a6525650c2ca6ca3914c5c5 Update CHANGELOG for FirebaseFirestoreSwift v0.3 (#5583) by Gil <mcg@google.com> - 9f17a76e825df5a8bca0985fc0d542f40a6c8541 Spelling error in FirestoreDecodingError (#5520) by Lorenzo Fiamingo <l99fiamingo@gmail.com> - 8633f5f6a3ca936085c9ee90680b45660eb19dd0 Make sure every member of `Error` enum has the `kError` p... by Konstantin Varlamov <var-const@users.noreply.github.com> - df3679275cd5ec7c8f044a4d1bee50f0e8ab43fe Add an integration test for calling clearPersistence() on... by Denver Coneybeare <dconeybe@google.com> PiperOrigin-RevId: 315635221
1 parent cff3b63 commit 7c1d0b7

20 files changed

+46
-43
lines changed

cmake/external/firestore.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if(TARGET firestore)
1818
return()
1919
endif()
2020

21-
set(version Firestore-1.13.0)
21+
set(version Firestore-1.15.0)
2222

2323
ExternalProject_Add(
2424
firestore

firestore/src/android/document_reference_android.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class DocumentReferenceInternal
167167
* only DocumentSnapshot.getMetadata() changed) should trigger snapshot
168168
* events.
169169
* @param[in] callback function or lambda to call. When this function is
170-
* called, snapshot value is valid if and only if error is Error::kOk.
170+
* called, snapshot value is valid if and only if error is Error::kErrorOk.
171171
*
172172
* @return A registration object that can be used to remove the listener.
173173
*

firestore/src/android/event_listener_android.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void EventListenerInternal::DocumentEventListenerNativeOnEvent(
5757
reinterpret_cast<EventListener<DocumentSnapshot>*>(listener_ptr);
5858
Error error_code =
5959
FirebaseFirestoreExceptionInternal::ToErrorCode(env, error);
60-
if (error_code != Error::kOk) {
60+
if (error_code != Error::kErrorOk) {
6161
listener->OnEvent(DocumentSnapshot{}, error_code);
6262
return;
6363
}
@@ -79,7 +79,7 @@ void EventListenerInternal::QueryEventListenerNativeOnEvent(
7979
reinterpret_cast<EventListener<QuerySnapshot>*>(listener_ptr);
8080
Error error_code =
8181
FirebaseFirestoreExceptionInternal::ToErrorCode(env, error);
82-
if (error_code != Error::kOk) {
82+
if (error_code != Error::kErrorOk) {
8383
listener->OnEvent(QuerySnapshot{}, error_code);
8484
return;
8585
}
@@ -100,7 +100,7 @@ void EventListenerInternal::VoidEventListenerNativeOnEvent(JNIEnv* env,
100100
EventListener<void>* listener =
101101
reinterpret_cast<EventListener<void>*>(listener_ptr);
102102

103-
listener->OnEvent(Error::kOk);
103+
listener->OnEvent(Error::kErrorOk);
104104
}
105105

106106
/* static */

firestore/src/android/firebase_firestore_exception_android.cc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,16 @@ METHOD_LOOKUP_DEFINITION(illegal_state_exception,
5151
Error FirebaseFirestoreExceptionInternal::ToErrorCode(JNIEnv* env,
5252
jobject exception) {
5353
if (exception == nullptr) {
54-
return Error::kOk;
54+
return Error::kErrorOk;
5555
}
5656

5757
// Some of the Precondition failure is thrown as IllegalStateException instead
5858
// of a FirebaseFirestoreException. So we convert them into a more meaningful
5959
// code.
6060
if (env->IsInstanceOf(exception, illegal_state_exception::GetClass())) {
61-
return Error::kFailedPrecondition;
61+
return Error::kErrorFailedPrecondition;
6262
} else if (!IsInstance(env, exception)) {
63-
return Error::kUnknown;
63+
return Error::kErrorUnknown;
6464
}
6565

6666
jobject code = env->CallObjectMethod(
@@ -72,8 +72,9 @@ Error FirebaseFirestoreExceptionInternal::ToErrorCode(JNIEnv* env,
7272
env->DeleteLocalRef(code);
7373
CheckAndClearJniExceptions(env);
7474

75-
if (code_value > Error::kUnauthenticated || code_value < Error::kOk) {
76-
return Error::kUnknown;
75+
if (code_value > Error::kErrorUnauthenticated ||
76+
code_value < Error::kErrorOk) {
77+
return Error::kErrorUnknown;
7778
}
7879
return static_cast<Error>(code_value);
7980
}
@@ -87,7 +88,7 @@ std::string FirebaseFirestoreExceptionInternal::ToString(JNIEnv* env,
8788
/* static */
8889
jthrowable FirebaseFirestoreExceptionInternal::ToException(
8990
JNIEnv* env, Error code, const char* message) {
90-
if (code == Error::kOk) {
91+
if (code == Error::kErrorOk) {
9192
return nullptr;
9293
}
9394
// FirebaseFirestoreException requires message to be non-empty. If the caller

firestore/src/android/promise_android.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,18 @@ class Promise {
8686
return;
8787
}
8888

89-
Error error_code = Error::kUnknown;
89+
Error error_code = Error::kErrorUnknown;
9090
switch (result_code) {
9191
case util::kFutureResultFailure:
9292
// When failed, result is the exception raised.
9393
error_code = FirebaseFirestoreExceptionInternal::ToErrorCode(
9494
this->firestore_->app()->GetJNIEnv(), result);
9595
break;
9696
case util::kFutureResultCancelled:
97-
error_code = Error::kCancelled;
97+
error_code = Error::kErrorCancelled;
9898
break;
9999
default:
100-
error_code = Error::kUnknown;
100+
error_code = Error::kErrorUnknown;
101101
FIREBASE_ASSERT_MESSAGE(false, "unknown FutureResult %d",
102102
result_code);
103103
break;
@@ -130,10 +130,10 @@ class Promise {
130130
PublicT future_result = FirestoreInternal::Wrap<InternalT>(
131131
new InternalT(this->firestore_, result));
132132

133-
this->impl_->CompleteWithResult(this->handle_, Error::kOk,
133+
this->impl_->CompleteWithResult(this->handle_, Error::kErrorOk,
134134
/*error_msg=*/"", future_result);
135135
if (this->completion_ != nullptr) {
136-
this->completion_->CompleteWith(Error::kOk, /*error_message*/ "",
136+
this->completion_->CompleteWith(Error::kErrorOk, /*error_message*/ "",
137137
&future_result);
138138
}
139139
delete this;
@@ -146,9 +146,9 @@ class Promise {
146146
using CompleterBase<void>::CompleterBase;
147147

148148
void SucceedWithResult(jobject result) override {
149-
this->impl_->Complete(this->handle_, Error::kOk, /*error_msg=*/"");
149+
this->impl_->Complete(this->handle_, Error::kErrorOk, /*error_msg=*/"");
150150
if (this->completion_ != nullptr) {
151-
this->completion_->CompleteWith(Error::kOk, /*error_message*/ "",
151+
this->completion_->CompleteWith(Error::kErrorOk, /*error_message*/ "",
152152
nullptr);
153153
}
154154
delete this;

firestore/src/android/transaction_android.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ DocumentSnapshot TransactionInternal::Get(const DocumentReference& document,
142142
return DocumentSnapshot{};
143143
} else {
144144
if (error_code != nullptr) {
145-
*error_code = Error::kOk;
145+
*error_code = Error::kErrorOk;
146146
}
147147
if (error_message != nullptr) {
148148
*error_message = "";

firestore/src/common/futures.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Future<T> CreateFailedFuture(
1818
ReferenceCountedFutureImpl* ref_counted_future_impl) {
1919
SafeFutureHandle<T> handle = ref_counted_future_impl->SafeAlloc<T>();
2020
ref_counted_future_impl->Complete(
21-
handle, Error::kFailedPrecondition,
21+
handle, Error::kErrorFailedPrecondition,
2222
"This instance is in an invalid state. This could either because the "
2323
"underlying Firestore instance has been destructed or because you're "
2424
"running on an unsupported platform. Currently the Firestore C++/Unity "

firestore/src/include/firebase/csharp/snapshots_in_sync_listener.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ListenerRegistration SnapshotsInSyncListener::AddListenerTo(
1818
SnapshotsInSyncListener listener(callback_id, callback);
1919

2020
return firestore->AddSnapshotsInSyncListener(
21-
[listener]() mutable { listener.OnEvent(Error::kOk); });
21+
[listener]() mutable { listener.OnEvent(Error::kErrorOk); });
2222
}
2323

2424
} // namespace csharp

firestore/src/include/firebase/csharp/typemap_helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace csharp {
1818

1919
struct TransactionGetResult {
2020
DocumentSnapshot snapshot;
21-
Error error_code = Error::kUnknown;
21+
Error error_code = Error::kErrorUnknown;
2222
std::string error_message;
2323
};
2424

firestore/src/include/firebase/csharp/unity_transaction_function.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Error UnityTransactionFunction::Apply(Transaction& transaction,
1919
} else {
2020
FIREBASE_ASSERT_MESSAGE(
2121
false, "C++ transaction callback called before C# registered.");
22-
return Error::kOk;
22+
return Error::kErrorOk;
2323
}
2424
}
2525

0 commit comments

Comments
 (0)