Skip to content

fix(desktop): keep connection detail sibling keys distinct - #6272

Open
chihumyum wants to merge 1 commit into
apache:mainfrom
chihumyum:fix/providers-detail-duplicate-key
Open

chihumyum wants to merge 1 commit into
apache:mainfrom
chihumyum:fix/providers-detail-duplicate-key

Conversation

@chihumyum

Copy link
Copy Markdown
Contributor

Summary

Opening any connection's detail page (Settings → Models → a connection) logs React's "Encountered two children with the same key, <connectionId>". #5866 keyed ConnectionDefaultAction by the connection id so its dialog state resets when the selection changes, but its sibling ConnectionDetail under the same level is keyed by the same id. This prefixes the default action's key, so both still remount per connection and the keys no longer collide.

Verification

  • New render test in connection-settings-locale-render.test.ts: fails on main (7 duplicate-key errors for relay-connection), passes with the fix; the file's 41 tests pass.
  • tsc -p tsconfig.renderer.json / tsconfig.main.json clean; check-renderer-architecture.mjs passes, also with --base upstream/main --strict-base; biome lint on both files clean.
  • Fixture app (MAKA_E2E_FIXTURE=settings-connections, dev:hmr), driven over CDP: opening both fixture connections' details logged 2 duplicate-key errors with main's key and 0 console errors/warnings with the fix.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope:

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

Opening any connection's detail logged "Encountered two children with
the same key": ConnectionDefaultAction (keyed per connection in apache#5866 so
its state resets when the selection changes) and ConnectionDetail both
used the connection id as their key under the same level. Prefix the
default action's key so both still remount per connection without
colliding, and cover it in the providers-panel render test.
@github-actions github-actions Bot added the effort/S Under 100 readable lines label Oct 23, 2026

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.

Reviewed both changed files at b74adde0e76ed80a01f165e82fe7f631b3d30559. I found no confirmed P0–P2 issue.

ConnectionDefaultAction now uses a prefixed connection-specific key, distinct from its ConnectionDetail sibling (apps/desktop/src/renderer/settings/providers-panel.tsx:361). Both keys still change with the selected connection, preserving the intended per-connection remount. The added mounted-render regression checks the actual connection-detail surface for duplicate-key errors (connection-settings-locale-render.test.ts:562).

Fresh dependencies/patches, the normal root build, renderer build and renderer typecheck passed. All 41 connection-settings render tests passed. Supplying only main's actual previous providers-panel.tsx to the same test's renderer bundler makes the new regression fail with React's duplicate relay-connection key warning. Changed-file lint, strict renderer architecture, ASF headers, diff checks, epoch guard (228; no protocol change) and static merge passed. Current-head test/label CI is successful and the PR is mergeable.

P3: the PR's AI-use choices are both still unchecked. Please select the applicable statement and, if generative tooling made a substantive contribution, identify it and preserve the required commit attribution.

I did not run a packaged Electron/CDP session or the complete Desktop/repository suites. The mounted tests use the real renderer components with controlled bridge responses.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/S Under 100 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants