fix(ui): prevent silent overwrite of existing API key connections on … - #6499
Conversation
…re-add
When adding a second API key for the same provider, the backend uses a
name-based upsert. Since all new connections defaulted to the name "main",
the second key would silently overwrite the first one with no warning to
the user.
Changes:
- Add existingConnectionCount prop threaded from ProviderDetailPageClient
through ProviderModalsPanel into AddApiKeyModal
- Compute a unique default connection name based on existing count to
prevent name collision: first connection defaults to "main" (backward
compatible), subsequent ones get a numeric suffix ("main-2", "main-3", ...)
- Properly reset entire form state on modal open (not just baseUrl) to
avoid stale field values leaking across opens
Fixes silent data loss when managing multiple API keys for the same provider.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
…n overwrite (diegosouzapw#6499) Sync onto release/v3.8.46. Extracted the pure name derivation to computeConnectionDefaultName.ts (unit-tested) and trimmed the on-open form reset to a spread so it doesn't drop the GLM team-quota fields (diegosouzapw#6351) while keeping the frozen-modal growth minimal (+7). Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>
|
Merged — thank you, @dilneiss! Synced onto |
526048d
into
diegosouzapw:release/v3.8.46
…re-add (diegosouzapw#6499) Unique default connection name prevents silent overwrite of existing API-key connections. Integrated into release/v3.8.46 with a unit-tested helper; remaining file-size reds are pre-existing base-red drift.
…re-add (diegosouzapw#6499) Unique default connection name prevents silent overwrite of existing API-key connections. Integrated into release/v3.8.46 with a unit-tested helper; remaining file-size reds are pre-existing base-red drift.
…re-add
When adding a second API key for the same provider, the backend uses a name-based upsert. Since all new connections defaulted to the name "main", the second key would silently overwrite the first one with no warning to the user.
Changes:
Fixes silent data loss when managing multiple API keys for the same provider.
Summary
Related Issues
Validation
npm run lintnpm run test:unitnpm run test:coverage>= 60%for statements, lines, functions, and branchesTests Added Or Updated
Coverage Notes
src/,open-sse/,electron/, orbin/, explain which tests cover the change.Reviewer Notes