File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,10 @@ void main() {
180180
181181        expect (db.select ('select 1 from ps_sync_state where priority = ?' , [i]),
182182            isNotEmpty);
183+         // A sync at this priority includes all higher priorities too, so they 
184+         // should be cleared. 
185+         expect (db.select ('select 1 from ps_sync_state where priority < ?' , [i]),
186+             isEmpty);
183187      }
184188    });
185189
@@ -192,10 +196,13 @@ void main() {
192196          isTrue);
193197      expect (db.select ('SELECT powersync_last_synced_at() AS r' ).single,
194198          {'r' :  isNotNull});
199+       expect (db.select ('SELECT priority FROM ps_sync_state' ).single,
200+           {'priority' :  2147483647 });
195201
196202      db.execute ('SELECT powersync_clear(0)' );
197203      expect (db.select ('SELECT powersync_last_synced_at() AS r' ).single,
198204          {'r' :  isNull});
205+       expect (db.select ('SELECT * FROM ps_sync_state' ), hasLength (0 ));
199206    });
200207  });
201208}
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments