fix(ios): do not treat WAL sidecars as dual databases - #758
Conversation
PR #755 threw DB_DUAL_DATABASES when Library/vitruvian.db was absent but SQLiter still had vitruvian.db-wal/-shm. That is the normal pre-cutover WAL layout, not two databases. Keep failing closed only when both main files exist, or when a Library main would be copied onto leftover SQLiter sidecars.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Code Review Roast 🔥Verdict: No Issues Found | Recommendation: Merge Oh wait, this PR is actually clean. I had my flamethrower warmed up and everything, ready to roast some The bug in PR #755 was a classic case of treating a symptom as the disease: WAL sidecars without a main file are normal SQLite post-checkpoint garbage, not a second database. This PR correctly narrows the throw to the two cases that actually matter (both mains exist, or a Library main would clobber leftover SQLiter sidecars) and lets everything else pass through. The four new tests pin each branch — including the "don't regress into over-permissiveness" guard test — which is the kind of thing senior reviewers love to see and rarely do. The extracted Correctness / Safety Findings Ponytail Review Ponytail net: 0 lines. Suggested Minimal Patch Final Merge Guidance Files Reviewed (2 files)
📊 Overall: Like a bartender who actually knows when to stop pouring. PR #755 was over-served; PR #758 knows the difference between WAL residue and a real dual-database emergency. Reviewed by minimax-m3 · Input: 35.8K · Output: 5.9K · Cached: 138.6K Review guidance: REVIEW.md from base branch |
Fixes #757
Summary
TestFlight 1.0.2 (2026090419) shows non-retryable
DB_DUAL_DATABASESeven though PR #755 is in that build.migrateLegacyLibraryRootIfNeeded()threw whenever SQLiter hadvitruvian.dbWAL sidecars andLibrary/vitruvian.dbwas absent. That Library path was never the live SQLiter location. The coordinator never got to migratevitruvian.db→phoenix.db.What changed
Verification
Issue725RecurrenceTestnew cases (SQLiter legacy+WAL, orphan sidecars, true dual mains).Issue725RecurrenceTest(9 tests, 0 failures, parent--rerun-tasks).Issue725FreshInstallDriverFactoryTest(2 tests, 0 failures).DatabaseFileMigrationCoordinatorTest(23 tests, 0 failures).:shared:compileKotlinIosArm64.Android file-migration paths are untouched.