feat(import): dedup dialog when importing duplicate connections#1462
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa5b543b71
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| normalizedLookupKey(connection.host), | ||
| String(connection.port), | ||
| normalizedLookupKey(connection.database), | ||
| normalizedLookupKey(connection.username) |
There was a problem hiding this comment.
Include Redis DB in duplicate keys
For Redis connections the selected database is stored in redisDatabase (and connection setup falls back to it when database is empty), but this new duplicate key only compares database. Importing a Redis connection for DB 1 when an otherwise identical DB 0 connection already exists will be marked as a duplicate, so choosing Replace can overwrite the wrong saved connection or the distinct DB is skipped by default.
Useful? React with 👍 / 👎.
# Conflicts: # CHANGELOG.md
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dbdb7962a0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ConnectionExportService.restoreCredentials( | ||
| from: preview.envelope, | ||
| connectionIdMap: result.connectionIdMap | ||
| connectionIdMap: result.newConnectionIdMap |
There was a problem hiding this comment.
Restore credentials for replaced imports
When importing from another app with credentials and the user selects Replace for a duplicate, prepareImport only records added rows in newConnectionIdMap, so passing this map makes restoreCredentials skip the replaced connection entirely. The connection settings are overwritten, but the saved password/SSH/plugin secrets remain stale or missing for the existing UUID; use the full connectionIdMap for replacements that should receive the imported credentials.
Useful? React with 👍 / 👎.
Summary
(host, port, database, username), case-insensitiveTest plan
ConnectionImportServiceTestsall pass