Previously cipher_page_size was set AFTER the verification SELECT, making it a no-op (SQLCipher locks page size on first access). This caused two bugs: 1. Databases were created with the default page size regardless of the setting, then flushed on close using misaligned 4KB mmap pages on 16KB kernel → corrupted file → SQLITE_NOTADB on reopen. 2. Reopening an existing DB used default (potentially wrong) page size for the initial read → decryption failure. Fix: batch all cipher settings (key, page_size, kdf_iter, algorithms) into a single execute_batch call BEFORE the first SELECT. This ensures: - New databases are created with 16KB pages (aligned to Asahi kernel) - Existing 16KB-page databases are reopened with the correct page size - Close/flush operations use properly aligned mmap → no corruption Note: existing 4KB-page databases (from v0.1.0) remain incompatible and must be deleted once on upgrade. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| ai | ||
| audit | ||
| commands | ||
| db | ||
| docs | ||
| integrations | ||
| ollama | ||
| pii | ||
| lib.rs | ||
| main.rs | ||
| state.rs | ||