Skip to content

Add optional recovery-wallet file purge to Settings wipe-data flow#883

Draft
Copilot wants to merge 1 commit into
mainfrom
copilot/add-wipe-data-tickbox
Draft

Add optional recovery-wallet file purge to Settings wipe-data flow#883
Copilot wants to merge 1 commit into
mainfrom
copilot/add-wipe-data-tickbox

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 29, 2026

The Settings wipe-data dialog now supports explicitly removing recovery wallet artifacts, not just app data/wallet records. A new opt-in checkbox allows users to delete encrypted wallet backups and remove the wallet storage file during wipe.

  • UI: Wipe Data modal

    • Added Delete recovery wallet files checkbox in the wipe confirmation modal.
    • Added explanatory text: This will delete the encrypted wallet backups from the system.
    • Bound checkbox state to a new DeleteRecoveryWalletFiles ViewModel property.
  • Wipe flow behavior

    • OpenWipeDataModal / CloseWipeDataModal now reset the new checkbox state.
    • ConfirmWipeData keeps existing wipe behavior, and conditionally executes recovery-file purge when the checkbox is selected.
    • If recovery-file deletion fails, wipe flow surfaces an explicit failure toast and exits early.
  • SDK support for recovery-file deletion

    • Extended wallet app service with DeleteRecoveryWalletFilesAsync(bool deleteWalletFile).
    • Implemented purge logic in WalletAppService:
      • Clears in-memory sensitive wallet cache.
      • Removes secure key entries for stored wallet IDs.
      • Delegates wallet backup cleanup to wallet store.
    • Extended IWalletStore/WalletStore with ClearAll(bool deleteWalletFile):
      • false => empty wallets.json contents.
      • true => delete wallets.json file.
    • Extended IStore with Delete(string key) and implemented in FileStore/InMemoryStore.
if (DeleteRecoveryWalletFiles)
{
    var deleteRecoveryWalletFilesResult =
        await _walletAppService.DeleteRecoveryWalletFilesAsync(deleteWalletFile: true);
    if (deleteRecoveryWalletFilesResult.IsFailure)
    {
        ToastRequested?.Invoke("Wipe data failed while deleting encrypted wallet backups. Please try again.");
        return;
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants