You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SQLite stream retention cutoff on a whole second deletes same-second rows early #464
The SQLite retention sweep (cleanup_expired_stream_records in crates/storage-sqlite/src/stream.rs) deletes rows with created_at < cutoff as a text comparison. created_at carries a millisecond fraction (2026-10-23T14:19:07.123Z). The cutoff is format_timestamp(now - 24h), RFC 3339 from the time crate, which renders a whole second with no fraction (2026-10-23T14:19:07Z). When the cutoff lands on an exact whole second, every row in that same second (...07.123Z) sorts before it, because . sorts before Z, and is deleted up to a second early.
Reaching it needs now_utc() to return a zero sub-second on the sweep's read, so it fires rarely. The fix is to render the cutoff in the same millisecond shape as the column (sqlite_util::format_epoch_millis), with a unit test for a cutoff on a whole second.
Found while working on #463, which did not introduce or widen it.
Activity