-
Notifications
You must be signed in to change notification settings - Fork 28
[BUG] indexed_at Date Silently Defaults to Unix Epoch on Parse Failure #203
Copy link
Copy link
Closed
Labels
Description
Project
vgrep
Description
When reading file metadata from the database, the indexed_at timestamp uses parse().unwrap_or_default() which silently converts any invalid/corrupted date string to DateTime::default() (1970-01-01 00:00:00 UTC). This hides database corruption and makes debugging difficult.
Error Message
Debug Logs
System Information
Bounty Version: 0.1.0
OS: Ubuntu 24.04 LTS
CPU: AMD EPYC-Genoa Processor (8 cores)
RAM: 15 GBScreenshots
No response
Steps to Reproduce
- Manually corrupt the database:
sqlite3 ~/.vgrep/vgrep.db "UPDATE files SET indexed_at = 'invalid-date' WHERE rowid = 1;"
- Run status command:
vgrep status - Observe that affected files show
1970-01-01timestamp with no warning
Expected Behavior
- Invalid dates should be logged as warnings
- Users should be notified of database corruption
- Option to repair or re-index corrupted entries
Actual Behavior
- Invalid dates silently become Unix epoch (1970-01-01)
- No warning or error message
- Users unaware of data corruption
Additional Context
Location: src/core/db.rs:96 and src/core/db.rs:262
indexed_at: row.get::<_, String>(3)?.parse().unwrap_or_default(),Reactions are currently unavailable