Skip to content

Commit 5672a1a

Browse files
committed
libsql: Assert generation in sync_db_if_needed()
No need to continue further if we ended up here with zero generation.
1 parent 9ae8787 commit 5672a1a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

libsql/src/sync.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,7 @@ impl SyncContext {
628628
}
629629

630630
async fn sync_db_if_needed(&mut self, generation: u32) -> Result<()> {
631+
assert!(generation > 0, "generation should be > 0");
631632
// somehow we are ahead of the remote in generations. following should not happen because
632633
// we checkpoint only if the remote server tells us to do so.
633634
if self.durable_generation > generation {

0 commit comments

Comments
 (0)