fix: surface non-empty vault import destination#429
Open
Guardiola31337 wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
Related Android incident PR: worldcoin/wld-android#7895 handles INC-109 in the app while this WalletKit PR makes the non-empty credential-vault import destination explicit for consumers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Changes
StorageError::VaultImportDestinationNotEmpty { table }for vault backup imports into a destination that already has rows.Testing Instructions
cargo fmt --all --checkcargo test -p walletkit-core import_vault_backupNote
Low Risk
Small, localized change to backup import error handling and an early guard; no changes to encryption, credential writes, or successful restore paths.
Overview
Vault backup import now returns
StorageError::VaultImportDestinationNotEmpty { table }when the destination already has rows in backup tables (credential_records,blob_objects), instead of a generic vault DB error from the SQLite copy path.CredentialVault::import_plaintextruns a preflightensure_backup_destination_emptybeforecipher::import_plaintext_copy. Publicimport_vault_from_backupdocs note this case. The non-empty-vault test asserts the typed error and still checks data is unchanged after a failed import.Reviewed by Cursor Bugbot for commit b244bb6. Bugbot is set up for automated code reviews on this repo. Configure here.