Skip to content

Commit 0159f99

Browse files
committed
fix doc comments and changelog
1 parent 61200bc commit 0159f99

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

Firestore/CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# Unreleased
22
- [changed] Add more details to the assertion failure in Query::Comparator() to
33
help with future debugging (#9258).
4-
- [fixed] Fixed an issue where returning `nil` from the update closure when
5-
running a transaction caused a crash in Swift (#9426).
4+
- [fixed] **Breaking change:** Fixed an issue where returning `nil` from the
5+
update closure when running a transaction caused a crash in Swift by removing
6+
the auto-generated `async throw`ing method from the `FirebaseFirestore`
7+
module. In order to use the `async throw`ing transaction method, add the
8+
`FirebaseFirestoreSwift` module dependency to your build target (#9426).
69

710
# v8.14.0
811
- [fixed] Fixed compiler warnings in `local_serializer.cc` about "implicit

Firestore/Source/Public/FirebaseFirestore/FIRFirestore.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ NS_SWIFT_NAME(Firestore)
119119
* `FieldValue.increment()` inside a transaction counts as an additional write.
120120
*
121121
* In the updateBlock, a set of reads and writes can be performed atomically using the
122-
* `FIRTransaction` object passed to the block. After the updateBlock is run, Firestore will attempt
122+
* `Transaction` object passed to the block. After the updateBlock is run, Firestore will attempt
123123
* to apply the changes to the server. If any of the data read has been modified outside of this
124124
* transaction since being read, then the transaction will be retried by executing the updateBlock
125125
* again. If the transaction still fails after 5 retries, then the transaction will fail.
@@ -132,7 +132,7 @@ NS_SWIFT_NAME(Firestore)
132132
* parameter. If this is set, then the transaction will not attempt to commit, and the given error
133133
* will be passed to the completion block.
134134
*
135-
* The `FIRTransaction` object passed to the updateBlock contains methods for accessing documents
135+
* The `Transaction` object passed to the updateBlock contains methods for accessing documents
136136
* and collections. Unlike other firestore access, data accessed with the transaction will not
137137
* reflect local changes that have not been committed. For this reason, it is required that all
138138
* reads are performed before any writes. Transactions must be performed while online. Otherwise,

Firestore/Swift/Source/AsyncAwait/Firestore+AsyncAwait.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,29 +61,29 @@ import Foundation
6161
/// `FieldValue.serverTimestamp()`, `FieldValue.arrayUnion()`, `FieldValue.arrayRemove()`, or
6262
/// `FieldValue.increment()` inside a transaction counts as an additional write.
6363
///
64-
/// In the updateBlock, a set of reads and writes can be performed atomically using the
65-
/// `FIRTransaction` object passed to the block. After the updateBlock is run, Firestore will attempt
64+
/// In the `updateBlock`, a set of reads and writes can be performed atomically using the
65+
/// `Transaction` object passed to the block. After the `updateBlock` is run, Firestore will attempt
6666
/// to apply the changes to the server. If any of the data read has been modified outside of this
67-
/// transaction since being read, then the transaction will be retried by executing the updateBlock
67+
/// transaction since being read, then the transaction will be retried by executing the `updateBlock`
6868
/// again. If the transaction still fails after 5 retries, then the transaction will fail.
6969
///
70-
/// Since the updateBlock may be executed multiple times, it should avoiding doing anything that
70+
/// Since the `updateBlock` may be executed multiple times, it should avoiding doing anything that
7171
/// would cause side effects.
7272
///
73-
/// Any value maybe be returned from the updateBlock. If the transaction is successfully committed,
74-
/// then the completion block will be passed that value. The updateBlock also has an `NSError` out
73+
/// Any value maybe be returned from the `updateBlock`. If the transaction is successfully committed,
74+
/// then the completion block will be passed that value. The `updateBlock` also has an `NSError` out
7575
/// parameter. If this is set, then the transaction will not attempt to commit, and the given error
76-
/// will be passed to the completion block.
76+
/// will be returned.
7777
///
78-
/// The `FIRTransaction` object passed to the updateBlock contains methods for accessing documents
78+
/// The `Transaction` object passed to the `updateBlock` contains methods for accessing documents
7979
/// and collections. Unlike other firestore access, data accessed with the transaction will not
8080
/// reflect local changes that have not been committed. For this reason, it is required that all
8181
/// reads are performed before any writes. Transactions must be performed while online. Otherwise,
82-
/// reads will fail, the final commit will fail, and the completion block will return an error.
82+
/// reads will fail, the final commit will fail, and this function will return an error.
8383
///
84-
/// @param updateBlock The block to execute within the transaction context.
85-
/// @param completion The block to call with the result or error of the transaction. This
86-
/// block will run even if the client is offline, unless the process is killed.
84+
/// - Parameter updateBlock The block to execute within the transaction context.
85+
/// - Throws Throws an error if the transaction could not be committed, or if an error was explicitly specified in the `updateBlock` parameter.
86+
/// - Returns Returns the value returned in the `updateBlock` parameter if no errors occurred.
8787
func runTransaction(_ updateBlock: @escaping (Transaction, NSErrorPointer)
8888
-> Any?) async throws -> Any? {
8989
// This needs to be wrapped in order to express a nullable return value upon success.

0 commit comments

Comments
 (0)