stop a real vault's import from hanging the app. Three things were wrong at once on the confirm step: (1) Quadratic writes. confirmImport looped VaultRepository.addEntry, and every call took the lock and re-encrypted and rewrote the ENTIRE vault, so an 806-entry restore did 806 full-vault writes. New addEntries() inserts the batch under one lock with a single write, rolling back the whole batch if that write fails, matching addEntry's all-or-nothing behaviour. Measured on June's real entry count: 12ms batched vs 4368ms looped, and that 4.4s is a desktop JVM — on-device with real crypto it is far worse. (2) Main thread. viewModelScope defaults to Dispatchers.Main, so the vault creation (deliberately expensive key derivation), the REPLACE-mode clear, and all those writes ran on the UI thread. Android offered to kill the app. Each of those now runs under withContext(Dispatchers.Default). (3) No feedback. The screen simply froze. Working state now carries step copy ('creating your vault…', 'saving N entries…') shown with an indeterminate progress bar and a line telling the user to keep Peach open, alongside the existing rune animation on the PeachScript path. Also: stopped installing the debug build to June's phone — it lands as a separate app beside the real one and was confusing. ~/peach-push.sh is release-only now, and the debug app has been removed from the device.

dev · 7 weeks ago · 2026-07-24 · 2.6 MB

session: fix import ANR on a real-sized vault · agent: claude-opus-5

$ koh steal kepr.uk/peach-android@099f17d7211c
·
← 3573fda2b97b 8dffe25307ef →
⇓ download .face