4 KiB
4 KiB
Delete & Restore Feature Implementation Results
Date: 2026-03-29
Branch: phase1-dev
Commits:
da589ae78f- feat(wallet): complete SSSS round-trip with delete and restoreee439cb5a3- fix(wallet): use full URL for account data check
Feature 1: Delete Wallet with Warning Dialog ✅
Implementation
- Added
showDeleteConfirmation: Booleanstate toWalletPanelState - Created
WalletDeleteConfirmationDialog.ktcomposable:- Large ⚠️ warning icon
- Title: "Delete Wallet?"
- Warning body about permanent deletion and backup importance
- Checklist: "Written down your 24-word recovery phrase, OR Backed up to Matrix"
- "Cancel" button (safe, dismisses)
- "Delete Wallet" button (destructive, red)
- Non-dismissible (onDismissRequest = {}, BackHandler blocks back press)
- Added events:
DeleteWallet,ConfirmDeleteWallet,CancelDeleteWallet - Wired deletion in presenter: calls
keyStorage.deleteWallet(sessionId), thenwalletManager.clearState() - After deletion, panel shows wallet setup screen
Files Modified
WalletPanelState.kt- added showDeleteConfirmation fieldWalletPanelPresenter.kt- handle delete eventsWalletPanelView.kt- render dialog when showDeleteConfirmation=trueWalletDeleteConfirmationDialog.kt- new composable (created)OverviewTabView.kt- updated preview with new state fieldstrings.xml- added delete wallet strings
Feature 2: Restore from SSSS on Setup Screen ✅
Implementation
- Added
hasBackupWithoutKey(): Result<Boolean>toWalletBackupServiceinterface - Implementation uses
matrixClient.userIdServerName()to get homeserver domain - Constructs full Matrix API URL:
https://$serverName/_matrix/client/v3/user/$userId/account_data/$secretName - Uses
matrixClient.getUrl(url)to check if account data exists (without decryption) - Added state fields:
hasCloudBackup,isCheckingCloudBackup,cloudRestoreRecoveryKey,isRestoringFromCloud - Added
SetupStep.RESTORE_FROM_CLOUDstep - Added events:
RestoreFromCloud,UpdateCloudRestoreRecoveryKey,ConfirmCloudRestore - On setup init: silently checks
hasBackupWithoutKey() - If backup exists: shows "Restore from Matrix Backup" button below "Import Existing Wallet"
- Restore flow: user enters recovery key → decrypt mnemonic from SSSS → import wallet → show address
Files Modified
WalletBackupService.kt(api) - added hasBackupWithoutKey() methodWalletBackupServiceImpl.kt- implemented hasBackupWithoutKey()WalletSetupState.kt- added cloud backup state fields, RESTORE_FROM_CLOUD stepWalletSetupPresenter.kt- check for backup on init, handle restore eventsWalletSetupView.kt- RestoreFromCloudContent composable, show button when hasCloudBackup
APK Serving
arm64 APK available at: http://192.168.0.5:8888/app-fdroid-arm64-v8a-debug.apk
All APKs:
app-fdroid-arm64-v8a-debug.apk(220 MB)app-fdroid-armeabi-v7a-debug.apk(103 MB)app-fdroid-universal-debug.apk(405 MB)app-fdroid-x86-debug.apk(110 MB)app-fdroid-x86_64-debug.apk(224 MB)
Round-Trip Test
To test the full round-trip:
- Open app with existing wallet (should have backup at key
5b8ac89548308c51) - Go to Settings tab → tap "Delete Wallet"
- Warning dialog appears → tap "Delete Wallet" to confirm
- Wallet panel shows setup screen
- "Restore from Matrix Backup" button should appear (if hasBackupWithoutKey detected it)
- Tap restore → enter recovery key
5b8ac89548308c51 - Wallet restores with address:
addr_test1qzl3rfpsnejf5wjey74yxz8jzduqzxfq3ze6xsgfcrrt03dlmpn40atetazzuywm6eseptz3eh9z7y7tevgtmujwy3ussnvev7
Notes
- The
hasBackupWithoutKey()check makes an authenticated HTTP request to the Matrix API - If the check fails (network issues, etc.), it silently returns false and the button won't appear
- Users can always use "Import Existing Wallet" to manually enter their mnemonic as a fallback
- Delete dialog is non-dismissible - user must explicitly choose Cancel or Delete