Skip to content

Commit 402462a

Browse files
committed
fix(deploy): track first-pass fills to prevent stale baseConfig bypassing required-field validation
Use a dedicated `filledSubBlockIds` Set populated during the first pass so the second-pass skip guard is based solely on live `getConfigValue` results, not on stale entries spread from `baseConfig` (`triggerConfig`).
1 parent c7ae3ef commit 402462a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apps/sim/lib/webhooks/deploy.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ function buildProviderConfig(
185185

186186
const canonicalIndex = buildCanonicalIndex(triggerDef.subBlocks)
187187
const satisfiedCanonicalIds = new Set<string>()
188+
const filledSubBlockIds = new Set<string>()
188189

189190
const relevantSubBlocks = triggerDef.subBlocks.filter(
190191
(subBlock) =>
@@ -196,13 +197,14 @@ function buildProviderConfig(
196197
const valueToUse = getConfigValue(block, subBlock)
197198
if (valueToUse !== null && valueToUse !== undefined && valueToUse !== '') {
198199
providerConfig[subBlock.id] = valueToUse
200+
filledSubBlockIds.add(subBlock.id)
199201
const canonicalId = canonicalIndex.canonicalIdBySubBlockId[subBlock.id]
200202
if (canonicalId) satisfiedCanonicalIds.add(canonicalId)
201203
}
202204
}
203205

204206
for (const subBlock of relevantSubBlocks) {
205-
if (providerConfig[subBlock.id] !== undefined) continue
207+
if (filledSubBlockIds.has(subBlock.id)) continue
206208
const canonicalId = canonicalIndex.canonicalIdBySubBlockId[subBlock.id]
207209
if (canonicalId && satisfiedCanonicalIds.has(canonicalId)) continue
208210
if (isFieldRequired(subBlock, subBlockValues)) {

0 commit comments

Comments
 (0)