feat: add duplicate account import prevention #189
Reference in New Issue
Block a user
Delete Branch "account-import-duplicate-prevention"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The system now prevents users from importing the same account multiple times
by checking for existing DIDs both before import (pre-check) and during
save (post-check). Users receive clear warning messages instead of
technical errors when attempting to import duplicate accounts.
Files modified:
Resolves: Prevent duplicate account imports in IdentitySwitcherView
@trentlarson @anomalist I wanted to hear your thoughts on the changes, specifically the redundancies with the duplication checks when deriving from an existing seed and when adding a new identity. Is it too much, or just right?
This all looks good. I just tweaked the error-message logic, so you can see that they are guaranteed to use the exact same message.
I just added another commit for a small change: I removed the "catch" from a couple places because all it did was log a message and then rethrow the error, while adding some logging. (This can get confusing, especially when the calling code knows how to handle the error, so I prefer just to let it propagate.)
Duly noted on those last changes.