File tree 1 file changed +9
-6
lines changed
packages/firestore/src/remote
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -475,7 +475,15 @@ export abstract class PersistentStream<
475
475
this . stream = this . startRpc ( token ) ;
476
476
this . stream . onOpen ( ( ) => {
477
477
dispatchIfNotClosed ( ( ) => {
478
- debugAssert ( this . healthCheck === null , 'Expected healthCheck to be null' ) ;
478
+ debugAssert (
479
+ this . state === PersistentStreamState . Starting ,
480
+ 'Expected stream to be in state Starting, but was ' + this . state
481
+ ) ;
482
+ this . state = PersistentStreamState . Open ;
483
+ debugAssert (
484
+ this . healthCheck === null ,
485
+ 'Expected healthCheck to be null'
486
+ ) ;
479
487
this . healthCheck = this . queue . enqueueAfterDelay (
480
488
this . healthTimerId ,
481
489
HEALTHY_TIMEOUT_MS ,
@@ -486,11 +494,6 @@ export abstract class PersistentStream<
486
494
return Promise . resolve ( ) ;
487
495
}
488
496
) ;
489
- debugAssert (
490
- this . state === PersistentStreamState . Starting ,
491
- 'Expected stream to be in state Starting, but was ' + this . state
492
- ) ;
493
- this . state = PersistentStreamState . Open ;
494
497
return this . listener ! . onOpen ( ) ;
495
498
} ) ;
496
499
} ) ;
You can’t perform that action at this time.
0 commit comments