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
digest.rs:82-134 processes events one by one; upsert_issue then insert_event are separate statements. If insert fails, issue counts are bumped with no event row; failures are only logged and dropped.
purge_orphan_issues (sqlite.rs:836, postgres.rs:834) DELETE FROM issues WHERE id NOT IN (SELECT issue_id FROM events) can delete an issue just upserted before its event is inserted, and removes resolved/ignored issues whose events aged out (history lost).
SQLite retention (sqlite.rs:829, 844) compares RFC3339 received_at (T separator) against datetime('now', '-N days') (space separator): text compare is off by up to a day; Postgres behaves differently.
Fix
Wrap each batch in one transaction.
Purge orphans only with AND last_seen < cutoff, inside a transaction; keep resolved/ignored.
Bind a Rust-computed RFC3339 cutoff on both backends (also purge_stale_auth_attempts).
Activity
fix(db): atomic record_event, safe orphan purge, RFC3339 retention cu…