Skip to content

feat(import): dedup dialog when importing duplicate connections#1462

Open
J2TeamNNL wants to merge 8 commits into
TableProApp:mainfrom
J2TeamNNL:feat/import
Open

feat(import): dedup dialog when importing duplicate connections#1462
J2TeamNNL wants to merge 8 commits into
TableProApp:mainfrom
J2TeamNNL:feat/import

Conversation

@J2TeamNNL
Copy link
Copy Markdown
Contributor

Summary

  • When importing connections and a duplicate is detected (same host, port, database, username), a dialog offers: Replace, As Copy, or Skip
  • Dedup key is (host, port, database, username), case-insensitive
  • "As Copy" appends " (Imported)" with collision handling: " (Imported 2)", " (Imported 3)", etc.
  • "Replace" updates connection metadata only; existing Keychain entries are not overwritten for foreign-app imports
  • Warning strings for missing SSH keys, SSL certs, and unknown database types are now localized

Test plan

  • Import a file containing a connection already in TablePro → dialog appears with 3 options
  • Replace → existing connection updated, same ID
  • As Copy → new connection created with " (Imported)" suffix; importing twice produces " (Imported 2)"
  • Skip → connection not imported, no duplicate created
  • Import from DBeaver with duplicate → Replace does not overwrite existing password in Keychain
  • ConnectionImportServiceTests all pass

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +887 to +890
normalizedLookupKey(connection.host),
String(connection.port),
normalizedLookupKey(connection.database),
normalizedLookupKey(connection.username)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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.

1 participant