5a1b9d445c
Root cause of accounts not persisting: ensureCurrentAccountInStorage() was fire-and-forget (scope.launch), so loginWithKey() ran before the old account was saved. The old account was lost. Now all steps run sequentially in one coroutine. UI hanging fix: metadataVersion LaunchedEffect fired on every metadata event, doing encrypted file I/O each time. Now debounced with 2s delay so it only writes once after a batch of metadata settles. Also: - loadInternalAccount falls back to read-only (test updated) - bunker/nostrconnect paths also await ensureCurrentAccountInStorage Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>