Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(askar): throw error if imported wallet exists #1593

Merged

Conversation

genaris
Copy link
Contributor

@genaris genaris commented Sep 28, 2023

As pointed out in #1587, when importing a wallet that already exists, in Android and Node.js environments AFJ is overwriting it, while in iOS is throwing an error.

In this PR we make the behaviour consistent across platforms and always throw a WalletImportPathExistsError.

Here we also handle the case that helped to discover this error: when a wrong key was entered for an import, further attempts would fail because the wallet DB file has been already copied. So in case of any import error (other than path already existent), we now delete it to return file system to previous state.

@genaris genaris requested a review from a team as a code owner September 28, 2023 16:26
@genaris genaris linked an issue Sep 28, 2023 that may be closed by this pull request
@TimoGlastra TimoGlastra merged commit c2bb2a5 into openwallet-foundation:main Sep 29, 2023
7 checks passed
auer-martin pushed a commit to auer-martin/aries-framework-javascript that referenced this pull request Nov 15, 2023
auer-martin pushed a commit to auer-martin/aries-framework-javascript that referenced this pull request Dec 4, 2023
genaris added a commit to genaris/credo-ts that referenced this pull request Dec 4, 2023
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.

Import error on iOS
2 participants