Skip to content

Commit 7d199b0

Browse files
committed
addressing comments #2
1 parent 2715154 commit 7d199b0

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

packages/firestore/src/api/database.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,13 +483,13 @@ export class Firestore implements firestore.FirebaseFirestore, FirebaseService {
483483
* backend.
484484
*
485485
* The returned Promise resolves immediately if there are no outstanding writes. Otherwise, the
486-
* Task waits for all previously issued writes (including those written in a previous app
486+
* Promise waits for all previously issued writes (including those written in a previous app
487487
* session), but it does not wait for writes that were added after the method is called. If you
488488
* wish to wait for additional writes, you have to call `waitForPendingWrites()` again.
489489
*
490490
* Any outstanding `waitForPendingWrites()` Promises are rejected during user changes.
491491
*
492-
* @return A `Promise` which resolves when all currently pending writes have been
492+
* @return A Promise which resolves when all currently pending writes have been
493493
* acknowledged by the backend.
494494
*/
495495
_waitForPendingWrites(): Promise<void> {

packages/firestore/src/core/firestore_client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,9 @@ export class FirestoreClient {
523523
}
524524

525525
/**
526-
* Returns a Promise that resolves when when all writes that were pending at the time when this
527-
* method is called received server acknowledgement. An acknowledgement can be either acceptance
528-
* or rejections.
526+
* Returns a Promise that resolves when all writes that were pending at the time this
527+
* method was called received server acknowledgement. An acknowledgement can be either acceptance
528+
* or rejection.
529529
*/
530530
waitForPendingWrites(): Promise<void> {
531531
this.verifyNotShutdown();

packages/firestore/src/core/sync_engine.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -610,9 +610,8 @@ export class SyncEngine implements RemoteSyncer, SharedClientStateSyncer {
610610
}
611611

612612
/**
613-
* Registers a user callback with all the pending mutations at the moment of calling.
614-
* When all those mutations are either accepted or rejected by the server, the
615-
* registered callback will be triggered.
613+
* Registers a user callback that resolves when all pending mutations at the moment of calling
614+
* are acknowledged .
616615
*/
617616
async registerPendingWritesCallback(callback: Deferred<void>): Promise<void> {
618617
if (!this.remoteStore.canUseNetwork()) {

packages/firestore/test/integration/api/database.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,10 +1162,9 @@ apiDescribe('Database', (persistence: boolean) => {
11621162
// Prevent pending writes receiving acknowledgement.
11631163
await firestore.disableNetwork();
11641164

1165-
// `awaitsPendingWrites` is created when there is no pending writes, it will resolve
1166-
// immediately even if we are offline.
1167-
const awaitPendingWrites = waitForPendingWrites(firestore);
1168-
await awaitPendingWrites;
1165+
// `awaitsPendingWrites` is created when there is no pending writes, it will resolve
1166+
// immediately even if we are offline.
1167+
await waitForPendingWrites(firestore);
11691168
});
11701169
});
11711170
});

0 commit comments

Comments
 (0)