fix(webhooks): requeue deliveries dropped by retryable setup infrastructure failures - #7038
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview Webhook execution now re-enqueues the same delivery (same Introduces Reviewed by Cursor Bugbot for commit 95e763e. Configure here. |
Greptile SummaryThe PR requeues webhook deliveries after effect-free, retryable setup failures while preserving execution identity and releasing the idempotency claim.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/background/webhook-execution.ts | Adds bounded setup-failure requeueing, effect-boundary classification, cancellation-aware database backoff, and enqueue-failure logging restoration. |
| apps/sim/lib/core/idempotency/service.ts | Releases owned idempotency claims for typed effect-free setup failures rather than memoizing them. |
| apps/sim/lib/execution/preprocessing.ts | Marks retryable infrastructure failures and conditionally defers terminal error logging for attempts that will be retried. |
| apps/sim/lib/core/errors/retryable-infrastructure.ts | Adds postgres.js connection codes and the typed RetryableSetupError contract. |
| packages/utils/src/helpers.ts | Adds a shared interruptible sleep that cleans up its abort listener and timer. |
Sequence Diagram
sequenceDiagram
participant Provider
participant WebhookJob
participant Setup
participant Idempotency
participant Queue
Provider->>WebhookJob: Delivery already acknowledged
WebhookJob->>Idempotency: Claim delivery
WebhookJob->>Setup: Preprocess and load state
alt Retryable failure before workflow core
Setup-->>WebhookJob: RetryableSetupError
WebhookJob->>Idempotency: Release claim
WebhookJob->>Queue: Enqueue same execution with backoff
Queue->>WebhookJob: Retry attempt
else Workflow core starts
WebhookJob->>WebhookJob: Execute workflow once
WebhookJob->>Idempotency: Memoize outcome
end
Reviews (2): Last reviewed commit: "fix(webhooks): restore terminal log on f..." | Re-trigger Greptile
…backoff abort-aware
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 95e763e. Configure here.
Summary
maxAttempts: 1, ingress has already ACKed the provider, and the idempotency key was memoized as failed for the 7-day dedupe window — so even provider redeliveries of the same event were rejectedretryable_setup_failurehandling, including theworkflowCoreStartedboundary so errors after the executor starts are never reclassified as retryable (no double-run risk); retries are capped byWEBHOOK_INFRA_RETRY_MAX_ATTEMPTS(default 5,0disables) and an exhausted budget still faults the run loudlyRetryableSetupErrorcontract inlib/core/errors/retryable-infrastructure: it certifies the operation performed no effect, soexecuteWithIdempotencyreleases the claim instead of memoizing the failure — the requeued run (or a later provider redelivery) can claim and executeCONNECT_TIMEOUT,CONNECTION_CLOSED,CONNECTION_ENDED,CONNECTION_DESTROYED) as retryable infrastructure — they previously fell outside the Node syscall / undici / Postgres server-code sets, which also weakened the schedule path's existing infra retrysuppressRetryableFailureLogsso an attempt that will be retried does not leave a terminal failed execution-log row (the retry reuses the execution id, which is unique per log row); the final attempt still records itType of Change
Testing
tsc --noEmit,bun run lint,bun run check:audits(33 audits), andbun run check:api-validationpassChecklist