Skip to content

Commit 287fbb1

Browse files
committed
fix(netlify): include deploy state in idempotency key
Multiple Netlify deploy events (created, building, succeeded) share the same deploy id, so keying dedup only on id collapsed distinct events into one. Including state plus the locked flag differentiates each event for the same deploy.
1 parent 36c8db9 commit 287fbb1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

apps/sim/lib/webhooks/providers/netlify.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,14 @@ export const netlifyHandler: WebhookProviderHandler = {
9494
},
9595

9696
extractIdempotencyId(body: unknown) {
97-
const id = (body as Record<string, unknown>)?.id
97+
const obj = body as Record<string, unknown> | undefined
98+
const id = obj?.id
9899
if (id === undefined || id === null || id === '') {
99100
return null
100101
}
101-
return `netlify:${String(id)}`
102+
const state = typeof obj?.state === 'string' ? obj.state : ''
103+
const locked = obj?.locked === true ? '1' : '0'
104+
return `netlify:${String(id)}:${state}:${locked}`
102105
},
103106

104107
async formatInput(ctx: FormatInputContext): Promise<FormatInputResult> {

0 commit comments

Comments
 (0)