fix: fix (reviewed): Webhook retry logic uses incorrect HTTP method on retries - #172
Open
Muyideen-js wants to merge 2 commits into
Open
fix: fix (reviewed): Webhook retry logic uses incorrect HTTP method on retries#172Muyideen-js wants to merge 2 commits into
Muyideen-js wants to merge 2 commits into
Conversation
|
@Muyideen-js Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Muyideen-js
marked this pull request as ready for review
September 1, 2026 16:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixed webhook retry logic to preserve the original HTTP method across retries.
Root cause:
service.go'sDelivermethod hardcodedhttp.MethodPostwhen constructing the retry request, ignoring the original request method stored on the delivery. This caused POST webhooks to be retried as GET requests.Changes:
Methodfield todomain.WebhookDeliverystruct.20260407000000_webhook_delivery_method) adding amethod TEXT NOT NULL DEFAULT 'POST'column towebhook_deliveries.webhook_repo.go(CreateDelivery, GetDelivery, ListDeliveries) to persist and read themethodcolumn.dispatcher.goto setMethod: http.MethodPostwhen creating a delivery.service.go'sDeliverto use the storeddeliv.Method(falling back to POST for legacy rows) instead of hardcodedhttp.MethodPost.TestWebhookService_RetryPreservesHTTPMethodverifying the retry uses the original POST method after a 503 failure.Changed files
db/migrations/20260407000000_webhook_delivery_method.down.sqldb/migrations/20260407000000_webhook_delivery_method.up.sqlinternal/domain/webhook.gointernal/postgres/webhook_repo.gointernal/webhook/dispatcher.gointernal/webhook/service.gointernal/webhook/service_test.goTest plan
Run
go test ./internal/webhook/...to verify the new regression test and existing webhook tests pass. Rungo build ./...to confirm compilation. The regression test spins up a mock webhook server returning 503 on the first attempt and verifies both attempts use the POST method.This PR was created as a draft by the issue solver bot. It will remain a
draft until repository CI passes.
Closes #132