Skip to content

Commit 52a064c

Browse files
fix: preserve existing API config ID on updates
- Ensure that the existing ID is retained when updating an API config. - Prevents unintentional ID changes during configuration updates.
1 parent 0097196 commit 52a064c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/core/config/ConfigManager.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,12 @@ export class ConfigManager {
9898
return await this.lock(async () => {
9999
const currentConfig = await this.readConfig()
100100

101+
// Preserve the existing ID if this is an update to an existing config
102+
const existingId = currentConfig.apiConfigs[name]?.id
103+
101104
currentConfig.apiConfigs[name] = {
102105
...config,
103-
id: config.id || this.generateId(),
106+
id: config.id || existingId || this.generateId(),
104107
}
105108

106109
await this.writeConfig(currentConfig)

0 commit comments

Comments
 (0)