fix(providers): derive new-connection default name from live names (closes #15006) - #15018
Merged
diegosouzapw merged 1 commit intoSep 29, 2026
Conversation
diegosouzapw
merged commit Sep 29, 2026
3b2c9fa
into
diegosouzapw:release/v3.8.51
11 of 16 checks passed
3 tasks
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.
Summary
Adding a connection after deleting one no longer defaults to a name that collides with a live connection. With
main/main-3live (main-2deleted), the modal proposedmain-3and the backend name-upsert silently overwrote it. It now proposes the first free slot (main-2).Related Issues
Root cause
AddApiKeyModalderived its default name fromconnections.length(ProviderDetailPageClient.tsx:850→ProviderModalsPanel→ modal), butcomputeConnectionDefaultNamehas had a names-array overload since #11067 that the modal never used. After any delete, count no longer matches the highest suffix, so the generated name hits a live row andfindExistingCookieConnection(src/lib/db/providers.ts:444, step 1 name-upsert) replaces it.Change
ProviderDetailPageClientpasses live connection names;ProviderModalsPanel/AddApiKeyModaltakeexistingConnectionNames?: string[]and use the names overload at both call sites (initial state + on-open reset). Single consumer chain, so the count prop is replaced, not kept alongside.db-provider-cookie-dedup-3368.test.ts:112([Feature] Robust web-session and no-auth auto routing with incremental PR plan #3368/feat(mcp): web-session robustness — cookie dedup (PR6) + browser-pool observability (PR7) (#3368) #5121). The frontend fix removes the collision path.docs/changelog/fragments/15006.md.Validation
modals/__tests__/addApiKeyModal-default-name-15006.test.tsx: fail→fix→pass verified (2 failed on the pre-fix file withexpected 'main' to be 'main-2', 3/3 pass with the fix)connModals.test.tsx: 20/20 passcompute-connection-default-name-6499/11033: 7/7 passnpm run linton touched files: clean (2 errors inProviderDetailPageClient.tsx:8,95and 1 dashboard-typecheck error inNoAuthAccountCard.tsxare pre-existing on the clean tip, verified via stash, left untouched)origin/release/v3.8.51Tests Added Or Updated
src/app/(dashboard)/dashboard/providers/[id]/components/modals/__tests__/addApiKeyModal-default-name-15006.test.tsxCoverage Notes
Reviewer Notes