mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-06 11:48:24 +00:00
The seven keys still read only from `secret_keeper` now have a home in the new stores. `nostr_pubkey` is the one that mattered: without it `loadAccountConfigFromEncryptedStorage` returns null and the account disappears from the app with its private key sitting safe and unreachable in the key store. Six are per-account and go into a new AccountIdentityStore in the account's plain DataStore — pubkey, external-signer flag and package, local relay servers, open backup conflicts, and the key-backup flag. All of it is public, and the store file is already named after the npub, so nothing is revealed that the file name does not reveal. Unlike the earlier plain-store groups, the legacy writes stay: a rollback that loses a setting is an annoyance, one that loses the pubkey is an empty app. `has_backed_up_keys` is carried but deliberately kept out of the group's save. The nudge writes it on its own, so a group save would carry a value its caller never knew about and put the nudge back in front of everyone. The seventh, `shared_settings`, is global and had already been superseded by UiSharedPreferences' own DataStore — except nothing ever moved the old blob across, and the fallback only fires when the new store *throws*, not when it is merely empty. It now carries a guarded copy: the destination has to be unsaved (no `ui.theme`) before the old blob is written into it, so an install that has been using the new store keeps everything it has. `saveSharedSettings` went with it, having had no callers since that store landed. Migrations are now tables of (legacy name -> Preferences.Key) owned by each store, rather than blocks of hand-written copy lines. The point is not brevity: a block cannot be asked what it covers, so the check that gates deleting the legacy file would have to restate the list, and a key added to one and not the other is exactly the silent hole that makes deletion unsafe. The rename pairs are worth having in one place too — five of DialogDismissalStore's nine keys changed name on the way in, and `relay_auth_trust_my_relays_and_venues` lost its suffix. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AXvKXakvup4inNFfAhhr4L