@@ -654,7 +654,7 @@ describeSpec('Existence Filters:', [], () => {
654
654
. restoreListen ( query1 , 'resume-token-1000' )
655
655
. watchAcks ( query1 )
656
656
// Nothing happened while this client was disconnected.
657
- // Bloom Filter includes the documents that match the query since the resume token.
657
+ // Bloom Filter includes docA as there are no changes since the resume token.
658
658
. watchFilters ( [ query1 ] , [ docA . key ] , bloomFilterProto )
659
659
// Expected count equals to documents in cache. Existence Filter matches.
660
660
. watchCurrents ( query1 , 'resume-token-2000' )
@@ -687,7 +687,8 @@ describeSpec('Existence Filters:', [], () => {
687
687
. watchAcks ( query1 )
688
688
// While this client was disconnected, another client added docB.
689
689
. watchSends ( { affects : [ query1 ] } , docB )
690
- // Bloom Filter includes the documents that match the query since the resume token.
690
+ // Bloom Filter includes all the documents that match the query, both
691
+ // those that haven't changed since the resume token and those newly added.
691
692
. watchFilters ( [ query1 ] , [ docA . key , docB . key ] , bloomFilterProto )
692
693
// Expected count equals to documents in cache. Existence Filter matches.
693
694
. watchCurrents ( query1 , 'resume-token-2000' )
@@ -701,7 +702,7 @@ describeSpec('Existence Filters:', [], () => {
701
702
'Resume a query with bloom filter when existing docs are updated' ,
702
703
[ ] ,
703
704
( ) => {
704
- const query1 = query ( 'collection' ) ;
705
+ const query1 = query ( 'collection' , filter ( 'v' , '>=' , 1 ) ) ;
705
706
const docA = doc ( 'collection/a' , 1000 , { v : 1 } ) ;
706
707
const docB = doc ( 'collection/b' , 1000 , { v : 1 } ) ;
707
708
const updatedDocB = doc ( 'collection/b' , 1000 , { v : 2 } ) ;
@@ -722,7 +723,8 @@ describeSpec('Existence Filters:', [], () => {
722
723
. watchAcks ( query1 )
723
724
// While this client was disconnected, another client updated fields in docB.
724
725
. watchSends ( { affects : [ query1 ] } , updatedDocB )
725
- // Bloom Filter includes the documents that match the query since the resume token.
726
+ // Bloom Filter includes all the documents that match the query, both
727
+ // those that have changed since the resume token and those that have not.
726
728
. watchFilters ( [ query1 ] , [ docA . key , updatedDocB . key ] , bloomFilterProto )
727
729
// Expected count equals to documents in cache. Existence Filter matches.
728
730
. watchCurrents ( query1 , 'resume-token-2000' )
@@ -743,7 +745,7 @@ describeSpec('Existence Filters:', [], () => {
743
745
744
746
const bloomFilterProto = generateBloomFilterProto ( {
745
747
contains : [ docA ] ,
746
- notContains : [ ]
748
+ notContains : [ docB ]
747
749
} ) ;
748
750
return (
749
751
spec ( )
@@ -795,7 +797,7 @@ describeSpec('Existence Filters:', [], () => {
795
797
// While this client was disconnected, another client modified docB to no longer match the
796
798
// query, deleted docC and added docD.
797
799
. watchSends ( { affects : [ query1 ] } , docD )
798
- // Bloom Filter includes all documents that match the query since the resume token .
800
+ // Bloom Filter includes all the documents that match the query.
799
801
. watchFilters ( [ query1 ] , [ docA . key , docD . key ] , bloomFilterProto )
800
802
. watchCurrents ( query1 , 'resume-token-2000' )
801
803
. watchSnapshots ( 2000 )
0 commit comments