File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
packages/firestore/src/remote Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -578,12 +578,12 @@ export class RemoteStore implements TargetMetadataProvider {
578
578
* Starts the write stream if necessary.
579
579
*/
580
580
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 ;
586
585
586
+ while ( this . canAddToWritePipeline ( ) ) {
587
587
try {
588
588
const batch = await this . localStore . nextMutationBatch (
589
589
lastBatchIdRetrieved
@@ -595,8 +595,8 @@ export class RemoteStore implements TargetMetadataProvider {
595
595
}
596
596
break ;
597
597
} else {
598
+ lastBatchIdRetrieved = batch . batchId ;
598
599
this . addToWritePipeline ( batch ) ;
599
- await this . fillWritePipeline ( ) ;
600
600
}
601
601
} catch ( e ) {
602
602
await this . disableNetworkUntilRecovery ( e ) ;
You can’t perform that action at this time.
0 commit comments