@@ -23,7 +23,7 @@ import { describeSpec, specTest } from './describe_spec';
2323import { spec } from './spec_builder' ;
2424import { RpcError } from './spec_rpc_error' ;
2525
26- describeSpec ( 'Existence Filters:' , [ 'exclusive' ] , ( ) => {
26+ describeSpec ( 'Existence Filters:' , [ ] , ( ) => {
2727 specTest ( 'Existence filter match' , [ ] , ( ) => {
2828 const query1 = query ( 'collection' ) ;
2929 const doc1 = doc ( 'collection/1' , 1000 , { v : 1 } ) ;
@@ -35,18 +35,20 @@ describeSpec('Existence Filters:', ['exclusive'], () => {
3535 . watchSnapshots ( 2000 ) ;
3636 } ) ;
3737
38- // TODO:(mila) update the tests when bloom filter is
39- specTest ( 'Existence filter with bloom filter match' , [ 'exclusive' ] , ( ) => {
38+ // This test is only to make sure watchFilters can accept bloom filter.
39+ // TODO:(mila) update the tests when bloom filter logic is implemented.
40+ specTest ( 'Existence filter with bloom filter match' , [ ] , ( ) => {
4041 const query1 = query ( 'collection' ) ;
4142 const doc1 = doc ( 'collection/1' , 1000 , { v : 1 } ) ;
4243 return spec ( )
4344 . userListens ( query1 )
4445 . watchAcksFull ( query1 , 1000 , doc1 )
4546 . expectEvents ( query1 , { added : [ doc1 ] } )
46- . watchFilters ( [ query1 ] , [ doc1 . key ] , { bits :{ bitmap :"a" , padding :1 } , hashCount :1 } )
47- . watchSnapshots ( 2000 )
48- . watchFilters ( [ query1 ] )
49- . watchSnapshots ( 3000 ) ;
47+ . watchFilters ( [ query1 ] , [ doc1 . key ] , {
48+ bits : { bitmap : 'a' , padding : 1 } ,
49+ hashCount : 1
50+ } )
51+ . watchSnapshots ( 2000 ) ;
5052 } ) ;
5153
5254 specTest ( 'Existence filter match after pending update' , [ ] , ( ) => {
@@ -126,8 +128,9 @@ describeSpec('Existence Filters:', ['exclusive'], () => {
126128 ) ;
127129 } ) ;
128130
129- // todo
130- specTest ( 'Existence filter mismatch triggers bloom filter' , [ 'exclusive' ] , ( ) => {
131+ // This test is only to make sure watchFilters can accept bloom filter.
132+ // TODO:(mila) update the tests when bloom filter logic is implemented.
133+ specTest ( 'Existence filter mismatch triggers bloom filter' , [ ] , ( ) => {
131134 const query1 = query ( 'collection' ) ;
132135 const doc1 = doc ( 'collection/1' , 1000 , { v : 1 } ) ;
133136 const doc2 = doc ( 'collection/2' , 1000 , { v : 2 } ) ;
@@ -136,7 +139,10 @@ describeSpec('Existence Filters:', ['exclusive'], () => {
136139 . userListens ( query1 )
137140 . watchAcksFull ( query1 , 1000 , doc1 , doc2 )
138141 . expectEvents ( query1 , { added : [ doc1 , doc2 ] } )
139- . watchFilters ( [ query1 ] , [ doc1 . key ] , { bits :{ bitmap :"a" , padding :1 } , hashCount :3 } ) // in the next sync doc2 was deleted
142+ . watchFilters ( [ query1 ] , [ doc1 . key ] , {
143+ bits : { bitmap : 'a' , padding : 1 } ,
144+ hashCount : 3
145+ } ) // in the next sync doc2 was deleted
140146 . watchSnapshots ( 2000 )
141147 // query is now marked as "inconsistent" because of filter mismatch
142148 . expectEvents ( query1 , { fromCache : true } )
0 commit comments