Add duplicate check in ImportAccountView before account import
Add duplicate check in ImportDerivedAccountView for derived accounts
Add safety check in saveNewIdentity function to prevent duplicate saves
Implement user-friendly warning messages for duplicate attempts
Add comprehensive error handling to catch duplicate errors from saveNewIdentity
Create Playwright tests to verify duplicate prevention functionality
Add documentation for duplicate prevention implementation
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:
src/views/ImportAccountView.vue: Add duplicate check and error handling
src/views/ImportDerivedAccountView.vue: Add duplicate check for derived accounts
src/libs/util.ts: Add duplicate prevention in saveNewIdentity
Resolves: Prevent duplicate account imports in IdentitySwitcherView
- Add duplicate check in ImportAccountView before account import
- Add duplicate check in ImportDerivedAccountView for derived accounts
- Add safety check in saveNewIdentity function to prevent duplicate saves
- Implement user-friendly warning messages for duplicate attempts
- Add comprehensive error handling to catch duplicate errors from saveNewIdentity
- Create Playwright tests to verify duplicate prevention functionality
- Add documentation for duplicate prevention implementation
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:
- src/views/ImportAccountView.vue: Add duplicate check and error handling
- src/views/ImportDerivedAccountView.vue: Add duplicate check for derived accounts
- src/libs/util.ts: Add duplicate prevention in saveNewIdentity
- test-playwright/duplicate-import-test.spec.ts: Add comprehensive tests
- doc/duplicate-account-import-implementation.md: Add implementation docs
Resolves: Prevent duplicate account imports in IdentitySwitcherView
- Add duplicate check in ImportAccountView before account import
- Add duplicate check in ImportDerivedAccountView for derived accounts
- Add safety check in saveNewIdentity function to prevent duplicate saves
- Implement user-friendly warning messages for duplicate attempts
- Add comprehensive error handling to catch duplicate errors from saveNewIdentity
- Create Playwright tests to verify duplicate prevention functionality
- Add documentation for duplicate prevention implementation
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:
- src/views/ImportAccountView.vue: Add duplicate check and error handling
- src/views/ImportDerivedAccountView.vue: Add duplicate check for derived accounts
- src/libs/util.ts: Add duplicate prevention in saveNewIdentity
- test-playwright/duplicate-import-test.spec.ts: Add comprehensive tests
- doc/duplicate-account-import-implementation.md: Add implementation docs
Resolves: Prevent duplicate account imports in IdentitySwitcherView
- Add NOTIFY_DUPLICATE_ACCOUNT_IMPORT constant for import warnings
- Add NOTIFY_DUPLICATE_DERIVED_ACCOUNT constant for derived account warnings
- Update ImportAccountView.vue to use notification constants
- Update ImportDerivedAccountView.vue to use notification constants
- Update test file to use notification constants for assertions
Centralizes notification messages for better maintainability and consistency
with the existing notification system.
Files modified:
- src/constants/notifications.ts: Add new notification constants
- src/views/ImportAccountView.vue: Replace hardcoded messages with constants
- src/views/ImportDerivedAccountView.vue: Replace hardcoded messages with constants
- test-playwright/duplicate-import-test.spec.ts: Update test assertions
@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?
@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?
- Replace constant usage with direct message string in ImportDerivedAccountView.vue
- Clean up import statement to remove unused import
- Remove unused constant from notifications.ts
- Extract checkForDuplicateAccount methods from ImportAccountView and ImportDerivedAccountView
- Create unified utility function in src/libs/util.ts with TypeScript overloads
- Support both direct DID checking and mnemonic+derivation path checking
- Improve error handling with centralized logging via PlatformServiceFactory
- Add comprehensive JSDoc documentation for both function overloads
- Remove unused imports (deriveAddress, newIdentifier) from ImportAccountView
The utility function now provides a clean API:
- checkForDuplicateAccount(did) - for direct DID checking
- checkForDuplicateAccount(mnemonic, derivationPath) - for derivation + checking
Both components maintain identical functionality while using centralized logic.
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.)
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.)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.