fix(connections): duplicate keeps advanced and protocol-specific fields - #92
Merged
GOODBOY008 merged 1 commit intoAug 14, 2026
Conversation
handleDuplicate hand-listed only auth + proxy fields when saving the duplicate, silently dropping ftpsEnabled, SSH compression/keepalive settings, RDP/VNC settings, and favorite/color/tags/description/sortOrder. Duplicate from the full saved connection record instead (saveConnection spreads Omit<ConnectionData,'id'|'createdAt'>), overriding only the name. Notes: lastConnected and profileId are intentionally carried over with the full copy (the duplicate inherits recency/quick-connect placement and the profile link). Also preserves the original port (previously node.port || 22 turned Raw/Serial's 0 into 22). Test: 577 tests pass, 2 new tests (connection-duplicate-fields.test.tsx) cover full-field carry-over and port 0 preservation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes connection duplication so all saved fields and port 0 are preserved.
Changes:
- Copies the complete connection record except identity fields.
- Adds regression tests for advanced fields and zero-valued ports.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/components/connection-manager.tsx |
Duplicates the full saved connection record. |
src/__tests__/connection-duplicate-fields.test.tsx |
Tests complete field and port preservation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #91
Problem
Duplicating a saved connection dropped all advanced/protocol-specific settings (
ftpsEnabled, SSHcompression/keepAlive/keepAliveInterval/serverAliveCountMax, RDPdomain/rdpResolution, VNCvncColorDepth/vncPassword) plusfavorite/color/tags/description/sortOrder.Change
handleDuplicatenow copies from the full saved record instead of a hand-listed whitelist —saveConnectionis already a full spread ofOmit<ConnectionData, 'id' | 'createdAt'>, so the duplicate inherits every field, with only the name overridden.Intentionally carried over:
lastConnected(duplicate inherits recency / quick-connect placement) andprofileId(both entries share the profile link). Bonus: originalportis preserved (previouslynode.port || 22turned Raw/Serial's default0into22).Tests
src/__tests__/connection-duplicate-fields.test.tsx: (1) deep-equal of the duplicate against the source minusid/createdAt/name(verified red before the fix — 11 vs 28 fields); (2) port0preserved for Raw/Serial.pnpm test: 577 pass;tsc --noEmitclean; eslint on changed files: 0 errors.