Skip to content

Commit ec2d7d2

Browse files
committed
addressing comments #4: better public comment.
1 parent 67fec18 commit ec2d7d2

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/FirebaseFirestore.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,12 +363,18 @@ Task<Void> shutdown() {
363363
}
364364

365365
/**
366-
* Waits until all pending writes that existed at the time of calling have been successfully
367-
* written to the server.
366+
* Waits until all currently pending writes for the active user have been acknowledged by the
367+
* backend.
368368
*
369-
* @return A {@code Task} which resolves when all pending writes are written to the backend. If
370-
* there is a Firebase user change, the returned {@code Task} will resolve to an exception. If
371-
* the client is offline, the returned {@code Task} will not resolve.
369+
* <p>The returned Task completes immediately if there are no outstanding writes. Otherwise, the
370+
* Task waits for all previously issued writes (including those written in a previous app
371+
* session), but it does not wait for writes that were added after the method is called. If you
372+
* wish to wait for additional writes, you have to call `waitForPendingWrites()` again.
373+
*
374+
* <p>Any outstanding `waitForPendingWrites()` Tasks are cancelled during user changes.
375+
*
376+
* @return A {@code Task} which resolves when all currently pending writes have been acknowledged
377+
* by the backend.
372378
*/
373379
Task<Void> waitForPendingWrites() {
374380
return client.waitForPendingWrites();

0 commit comments

Comments
 (0)