File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
packages/firestore/src/remote Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -682,13 +682,13 @@ export class PersistentWriteStream extends PersistentStream<
682
682
// Override of PersistentStream.start
683
683
start ( ) : void {
684
684
this . handshakeComplete_ = false ;
685
+ this . lastStreamToken = ByteString . EMPTY_BYTE_STRING ;
685
686
super . start ( ) ;
686
687
}
687
688
688
689
protected tearDown ( ) : void {
689
690
if ( this . handshakeComplete_ ) {
690
691
this . writeMutations ( [ ] ) ;
691
- this . lastStreamToken = ByteString . EMPTY_BYTE_STRING ;
692
692
}
693
693
}
694
694
@@ -742,6 +742,10 @@ export class PersistentWriteStream extends PersistentStream<
742
742
writeHandshake ( ) : void {
743
743
debugAssert ( this . isOpen ( ) , 'Writing handshake requires an opened stream' ) ;
744
744
debugAssert ( ! this . handshakeComplete_ , 'Handshake already completed' ) ;
745
+ debugAssert (
746
+ this . lastStreamToken . isEqual ( ByteString . EMPTY_BYTE_STRING ) ,
747
+ 'Stream token should be empty during handshake'
748
+ ) ;
745
749
// TODO(dimond): Support stream resumption. We intentionally do not set the
746
750
// stream token on the handshake, ignoring any stream token we might have.
747
751
const request : WriteRequest = { } ;
You can’t perform that action at this time.
0 commit comments