Common Local DB Failures
| Symptom | Likely cause | Fix |
|---|
| app crashes after update | missing migration path | add migration from old version and test with fixture |
| data disappeared after upgrade | destructive migration ran | restore backup, remove fallback for user data |
| backup misses latest rows | copied .db without WAL | use online backup API or VACUUM INTO |
| database is locked | long transaction or another process | shorten transactions, close readers, add timeout/retry |
| restore opens but data is wrong | imported unsupported version or partial files | validate manifest, schema, checksums, and row counts |
| search results stale | derived index not rebuilt | rebuild index from source data after import/migration |
| browser write fails | quota exceeded | show cleanup/export UX and request persistent storage |
| IndexedDB upgrade hangs | old tab holds DB connection | prompt reload/close other tabs |
SQLite Triage
PRAGMA database_list;
PRAGMA integrity_check;
PRAGMA foreign_key_check;
PRAGMA journal_mode;
Room Triage
- confirm the installed app version and DB version
- check exported schema history
- reproduce with an old fixture DB
- assert migration preserved representative rows
- inspect the device DB with Android Studio Database Inspector or
adb shell sqlite3
Browser Triage
- reproduce in a clean browser profile
- test private mode separately
- check storage estimate and persistence status
- test with another tab holding the old DB version