File tree Expand file tree Collapse file tree 4 files changed +23
-20
lines changed Expand file tree Collapse file tree 4 files changed +23
-20
lines changed Original file line number Diff line number Diff line change 2
2
- [ changed] Transactions now perform exponential backoff before retrying.
3
3
This means transactions on highly contended documents are more likely to
4
4
succeed.
5
+ - [ feature] Added a ` waitForPendingWrites() ` method to ` FIRFirestore ` class
6
+ which allows users to wait on a promise that resolves when all pending
7
+ writes are acknowledged by the Firestore backend.
5
8
6
9
# v1.4.5
7
10
- [ fixed] Fixed a crash that would happen when changing networks or going from
Original file line number Diff line number Diff line change @@ -90,22 +90,6 @@ NS_ASSUME_NONNULL_BEGIN
90
90
91
91
- (void )shutdownInternalWithCompletion : (nullable void (^)(NSError *_Nullable error))completion;
92
92
93
- /* *
94
- * Waits until all currently pending writes for the active user have been acknowledged by the
95
- * backend.
96
- *
97
- * The completion block is called immediately without error if there are no outstanding writes.
98
- * Otherwise, the completion block is called when all previously issued writes (including those
99
- * written in a previous app session) have been acknowledged by the backend. The completion
100
- * block does not wait for writes that were added after the method is called. If you
101
- * wish to wait for additional writes, you have to call `waitForPendingWritesWithCompletion`
102
- * again.
103
- *
104
- * Any outstanding `waitForPendingWritesWithCompletion` completion blocks are called with an
105
- * error during user change.
106
- */
107
- - (void )waitForPendingWritesWithCompletion : (void (^)(NSError *_Nullable error))completion ;
108
-
109
93
- (const std::shared_ptr<util::AsyncQueue> &)workerQueue ;
110
94
111
95
@property (nonatomic , assign , readonly ) std::shared_ptr<api::Firestore> wrapped;
Original file line number Diff line number Diff line change @@ -277,6 +277,10 @@ - (void)clearPersistenceWithCompletion:(nullable void (^)(NSError *_Nullable err
277
277
_firestore->ClearPersistence (util::MakeCallback (completion));
278
278
}
279
279
280
+ - (void )waitForPendingWritesWithCompletion : (void (^)(NSError *_Nullable error))completion {
281
+ _firestore->WaitForPendingWrites (util::MakeCallback (completion));
282
+ }
283
+
280
284
@end
281
285
282
286
@implementation FIRFirestore (Internal)
@@ -314,10 +318,6 @@ - (void)shutdownWithCompletion:(nullable void (^)(NSError *_Nullable error))comp
314
318
[self shutdownInternalWithCompletion: completion];
315
319
}
316
320
317
- - (void )waitForPendingWritesWithCompletion : (void (^)(NSError *_Nullable error))completion {
318
- _firestore->WaitForPendingWrites (util::MakeCallback (completion));
319
- }
320
-
321
321
@end
322
322
323
323
NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change @@ -192,6 +192,22 @@ NS_SWIFT_NAME(Firestore)
192
192
*/
193
193
- (void )clearPersistenceWithCompletion:(nullable void (^)(NSError *_Nullable error))completion;
194
194
195
+ /* *
196
+ * Waits until all currently pending writes for the active user have been acknowledged by the
197
+ * backend.
198
+ *
199
+ * The completion block is called immediately without error if there are no outstanding writes.
200
+ * Otherwise, the completion block is called when all previously issued writes (including those
201
+ * written in a previous app session) have been acknowledged by the backend. The completion
202
+ * block does not wait for writes that were added after the method is called. If you
203
+ * wish to wait for additional writes, you have to call `waitForPendingWritesWithCompletion`
204
+ * again.
205
+ *
206
+ * Any outstanding `waitForPendingWritesWithCompletion` completion blocks are called with an
207
+ * error during user change.
208
+ */
209
+ - (void )waitForPendingWritesWithCompletion:(void (^)(NSError *_Nullable error))completion;
210
+
195
211
@end
196
212
197
213
NS_ASSUME_NONNULL_END
You can’t perform that action at this time.
0 commit comments