Maintenance • Self-Healing
Database Corruption Recovery & Stream Salvage Engine
If SQLite database corruption occurs due to an ungraceful system shutdown or hardware fault, Nuncio automatically isolates damaged files and salvages valid records into a fresh database.
1. Automatic Recovery Pipeline Steps
- Startup Integrity Check (`PRAGMA quick_check(10)`): Executed every time `nunciod` or presentation shells open the database.
- Corrupted Backup Isolation (`CorruptedBackupManager`): Damaged `.db`, `.db-wal`, and `.db-shm` files are moved to `~/.nuncio/corrupted_backups/nuncio_corrupted_<timestamp>.db`.
- Stream Salvage Extraction (`SqliteRecoveryEngine`): Scans damaged B-trees to salvage valid `accounts`, `filter_rules`, and `filter_conditions`.
- Daemon Background Remote Resync: Remote IMAP, JMAP, and Google accounts trigger background sync to rebuild local message caches seamlessly.
2. Manual Database Integrity CLI Commands
# Run manual SQLite integrity check nuncio store check-integrity # View isolated corrupted backups directory ls -l ~/.nuncio/corrupted_backups/