-
Notifications
You must be signed in to change notification settings - Fork 28
[BUG] Database Query Errors Silently Filtered with filter_map(Result::ok) #205
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingideIssues related to IDEIssues related to IDEvalidValid issueValid issuevgrep
Description
Project
vgrep
Description
Multiple database query functions in src/core/db.rs use .filter_map(Result::ok) to collect results, which silently drops any rows that fail to deserialize. This can cause:
- Search results to be incomplete
- File listings to be missing entries
- No indication that errors occurred
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
- Corrupt a chunk entry in database:
sqlite3 ~/.vgrep/vgrep.db "UPDATE chunks SET content = NULL WHERE rowid = 1;"
- Run a search:
vgrep search "function" - Observe results - corrupted chunk silently missing, no error shown
Expected Behavior
- Database errors should be logged
- Partial failures should be reported to user
- Option to identify and repair corrupted entries
Actual Behavior
.filter_map(Result::ok)drops failed rows- No logging of which rows failed
- Users see incomplete results without knowing
Additional Context
Locations: src/core/db.rs:187, src/core/db.rs:220, src/core/db.rs:265
.filter_map(Result::ok) // Silently drops errors
.collect();Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingideIssues related to IDEIssues related to IDEvalidValid issueValid issuevgrep