fix: retry webhooks on 429 and 403 responses #931
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://linear.app/thirdweb/issue/PRO-160/engine-v2-only-retrying-webhook-on-500-errors
Previously, only 5xx errors triggered webhook retries. This change adds 429 (Too Many Requests) and 403 (Forbidden) to the retry logic, treating them the same as server errors with exponential backoff.
This prevents webhook events from being lost when the destination endpoint rate-limits requests or returns transient auth errors.
Also fixes a pre-existing lint error (unused template literal).
Changes
How this PR will be tested
Output
(Example: Screenshot/GIF for UI changes, cURL output for API changes)
PR-Codex overview
This PR enhances error handling in the
send-webhook-worker.tsfile by refining the conditions for retrying failed webhook requests. It updates the error message formatting and expands the range of HTTP status codes considered for retries.Detailed summary
messageformat from using backticks to standard quotes.429(rate limit) and403(forbidden).errorTypeto classify the error based on the status code.Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.