Skip to content

Commit

Permalink
fix: resume token should return previous (not 0) when nothing found (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dav1do authored Feb 8, 2024
1 parent 22eab7e commit 41fa8a8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions store/src/sqlite/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ where
let row_id: i64 = rows
.first()
.and_then(|r| r.get("new_highwater_mark"))
.unwrap_or(0);
.unwrap_or(row_id);
let rows = rows
.into_iter()
.map(|row| {
Expand Down Expand Up @@ -1378,7 +1378,11 @@ mod test {

let (hw, res) = store.new_keys_since_value_rowid(hw, 1).await.unwrap();
assert_eq!(1, res.len());
assert_eq!(22, hw); // see comment in prep_highwater_tests
assert_eq!(22, hw);
assert_eq!([key_c], res.as_slice());

let (hw, res) = store.new_keys_since_value_rowid(hw, 1).await.unwrap();
assert_eq!(0, res.len());
assert_eq!(22, hw); // previously returned 0
}
}

0 comments on commit 41fa8a8

Please sign in to comment.