Skip to content

Commit 09c50bb

Browse files
committed
fix format
1 parent e0ea8c9 commit 09c50bb

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

firebase-firestore/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Unreleased
2-
- [fixed] Fix FAILED_PRECONDITION when writing to a deleted document in a transaction. Ported from web SDK (#5871).JMASW N
2+
- [fixed] Fix FAILED_PRECONDITION when writing to a deleted document in a transaction. Ported from web SDK.
3+
See the [issue report in GitHub](https://github.com/firebase/firebase-js-sdk/issues/5871).
34
- [fixed] Fixed Firestore failing to raise initial snapshot from empty local cache result.
45

56
# 24.4.0
@@ -11,7 +12,6 @@
1112
The Kotlin extensions library transitively includes the updated
1213
`firebase-firestore` library. The Kotlin extensions library has the following
1314
additional updates:
14-
SDEW
1515
* [feature] Firebase now supports Kotlin coroutines.
1616
With this release, we added
1717
[`kotlinx-coroutines-play-services`](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-play-services/){: .external}

firebase-firestore/src/androidTest/java/com/google/firebase/firestore/TransactionTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,6 @@ public void testRunsTransactionsAfterGettingExistingDoc() {
250250
tt.withExistingDoc().run(get, set1, set2).expectDoc(map("foo", "bar2"));
251251
}
252252

253-
// This test is identical to the test above, except that withNonexistentDoc()
254-
// is replaced by withDeletedDoc(), to guard against regression of
255-
// https://github.com/firebase/firebase-js-sdk/issues/5871, where transactions
256-
// would incorrectly fail with FAILED_PRECONDITION when operations were
257-
// performed on a deleted document (rather than a non-existent document).
258253
@Test
259254
public void testRunsTransactionsAfterGettingNonexistentDoc() {
260255
FirebaseFirestore firestore = testFirestore();
@@ -273,6 +268,11 @@ public void testRunsTransactionsAfterGettingNonexistentDoc() {
273268
tt.withNonexistentDoc().run(get, set1, set2).expectDoc(map("foo", "bar2"));
274269
}
275270

271+
// This test is identical to the test above, except that withNonexistentDoc()
272+
// is replaced by withDeletedDoc(), to guard against regression of
273+
// https://github.com/firebase/firebase-js-sdk/issues/5871, where transactions
274+
// would incorrectly fail with FAILED_PRECONDITION when operations were
275+
// performed on a deleted document (rather than a non-existent document).
276276
@Test
277277
public void testRunsTransactionsAfterGettingDeletedDoc() {
278278
FirebaseFirestore firestore = testFirestore();

firebase-firestore/src/main/java/com/google/firebase/firestore/core/TransactionRunner.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ private void handleTransactionError(Task task) {
9595

9696
private static boolean isRetryableTransactionError(Exception e) {
9797
if (e instanceof FirebaseFirestoreException) {
98-
// In transactions, the backend will fail outdated reads with FAILED_PRECONDITION,non-matching
99-
// document versions with ABORTED, and attempts to create already exists with ALREADY_EXISTS.
100-
// These errors should be retried.
98+
// In transactions, the backend will fail outdated reads with FAILED_PRECONDITION,
99+
// non-matching document versions with ABORTED, and attempts to create already exists with
100+
// ALREADY_EXISTS. These errors should be retried.
101101
FirebaseFirestoreException.Code code = ((FirebaseFirestoreException) e).getCode();
102102
return code == FirebaseFirestoreException.Code.ABORTED
103-
|| code == FirebaseFirestoreException.Code.FAILED_PRECONDITION
104103
|| code == FirebaseFirestoreException.Code.ALREADY_EXISTS
104+
|| code == FirebaseFirestoreException.Code.FAILED_PRECONDITION
105105
|| !Datastore.isPermanentError(((FirebaseFirestoreException) e).getCode());
106106
}
107107
return false;

0 commit comments

Comments
 (0)