Skip to content

Refuse watch resume at u64::MAX instead of wrapping to 0 - #15

Merged
jaredLunde merged 2 commits into
beyondoss:mainfrom
paulocsanz:dst/resume-revision-wrap
Aug 14, 2026
Merged

Refuse watch resume at u64::MAX instead of wrapping to 0#15
jaredLunde merged 2 commits into
beyondoss:mainfrom
paulocsanz:dst/resume-revision-wrap

Conversation

@paulocsanz

Copy link
Copy Markdown
Contributor

resume_window_ok saturates at u64::MAX. The three NATS watch-from sites used wrapping revision + 1 and would seek at sequence 0. Two commits: tests that fail on main, then the fix.

  • protocol::resume_start_sequence is checked_add(1).
  • All three watch-from sites share it and return WatchError at u64::MAX.

protocol::resume_window_ok saturates at u64::MAX. The three watch
call sites used wrapping addition and would seek at sequence 0.
resume_start_sequence is checked_add(1). The three NATS watch-from
sites share it so they cannot drift from the protocol kernel.
@jaredLunde
jaredLunde merged commit ebcb4c5 into beyondoss:main Aug 14, 2026
1 check passed
@jaredLunde jaredLunde mentioned this pull request Aug 16, 2026
jaredLunde added a commit that referenced this pull request Aug 16, 2026
* chore: bump to 0.7.3 — durability fixes since 0.7.2

Ship the four post-0.7.2 snapshot/watch fixes to crates.io:
- #13 snapshot load must not drop a durable tail
- #14 fsync parent directory after compact rename
- #15 refuse watch resume at u64::MAX (no wrap to 0)
- #16 mid-file NULs must not drop a CRC-valid suffix

Also refresh README install snippets from 0.5 → 0.7.

Co-authored-by: Jared Lunde <jared.lunde@gmail.com>

* chore: sync Cargo.lock package version to 0.7.3

Co-authored-by: Jared Lunde <jared.lunde@gmail.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants