Skip to content

Commit 8c3f158

Browse files
Cleanup
1 parent 51ad82c commit 8c3f158

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/firestore/src/remote/remote_store.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -578,12 +578,12 @@ export class RemoteStore implements TargetMetadataProvider {
578578
* Starts the write stream if necessary.
579579
*/
580580
async fillWritePipeline(): Promise<void> {
581-
while (this.canAddToWritePipeline()) {
582-
const lastBatchIdRetrieved =
583-
this.writePipeline.length > 0
584-
? this.writePipeline[this.writePipeline.length - 1].batchId
585-
: BATCHID_UNKNOWN;
581+
let lastBatchIdRetrieved =
582+
this.writePipeline.length > 0
583+
? this.writePipeline[this.writePipeline.length - 1].batchId
584+
: BATCHID_UNKNOWN;
586585

586+
while (this.canAddToWritePipeline()) {
587587
try {
588588
const batch = await this.localStore.nextMutationBatch(
589589
lastBatchIdRetrieved
@@ -595,8 +595,8 @@ export class RemoteStore implements TargetMetadataProvider {
595595
}
596596
break;
597597
} else {
598+
lastBatchIdRetrieved = batch.batchId;
598599
this.addToWritePipeline(batch);
599-
await this.fillWritePipeline();
600600
}
601601
} catch (e) {
602602
await this.disableNetworkUntilRecovery(e);

0 commit comments

Comments
 (0)