| … | … | @@ -1171,7 +1172,7 @@ const make = Effect.gen(function* () { | |
| 1172 | 1173 | }); | |
| 1173 | 1174 | } | |
| 1174 | - | const updated = yield* update(current); | |
| 1175 | + | const updated = withoutRemovedSecretProviderReferences(current, yield* update(current)); | |
🟠 High src/serverSettings.ts:1175
Removing a secret provider while a patch echoes its credential as SECRET_REDACTED leaves a dangling credential in the persisted settings. withoutRemovedSecretProviderReferences runs before persistSettingsSecrets restores echoed references, so it sees only the marker and cannot clear the reference; resolve echoed references before this cleanup.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
| 1 | In file @apps/server/src/serverSettings.ts around line 1175: |
| 2 | |
| 3 | Removing a secret provider while a patch echoes its credential as `SECRET_REDACTED` leaves a dangling credential in the persisted settings. `withoutRemovedSecretProviderReferences` runs before `persistSettingsSecrets` restores echoed references, so it sees only the marker and cannot clear the reference; resolve echoed references before this cleanup. |
Fixed in 8788c6e13ac: echoed SECRET_REDACTED markers are restored to their references before the cleanup, so a removed provider's reference is cleared. The removal test now echoes the usage limit key as the marker in the same patch; it fails without the fix.
The commit addresses the issue. I couldn't verify it on the current branch, which appears to be at 033bc1f.
The PR head is now 8788c6e13ac, which contains the fix; the mirror had not caught up when you checked.
| … | … | @@ -239,3 +239,33 @@ function mapSecretFieldGroups( | |
| 249 | + | next: ServerSettings, | |
| 250 | + | ): ServerSettings { | |
| 251 | + | const removed = new Set( | |
| 252 | + | Object.keys(current.secretProviders).filter((id) => !(id in next.secretProviders)), | |
🟠 High src/settingsSecrets.ts:252
Removing the provider constructor leaves its credential and environment references intact, despite the confirmation that they will be unset. The in operator also finds inherited properties, so constructor is not added to removed; use an own-property check instead.
| 1 | Object.keys(current.secretProviders).filter((id) => !Object.prototype.hasOwnProperty.call(next.secretProviders, id)), |
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
| 1 | In file @apps/server/src/settingsSecrets.ts around line 252: |
| 2 | |
| 3 | Removing the provider `constructor` leaves its credential and environment references intact, despite the confirmation that they will be unset. The `in` operator also finds inherited properties, so `constructor` is not added to `removed`; use an own-property check instead. |
Fixed in 8788c6e13ac: the removed-provider check uses Object.hasOwn.
I couldn’t access that commit, and the current PR head still uses id in next.secretProviders. Could you check whether the fix was pushed?
The PR head is now 8788c6e13ac, which contains the fix; the mirror had not caught up when you checked.