Repository navigation
fix: never replay the webhook test call after a 5xx or a lost connection - #8
Merged
Merged
Conversation
POST /webhook-endpoints/{id}/test sends a real webhook.test event and the API ignores its Idempotency-Key, so the automatic retry could send a second event. The call is now retried on a 429 only (answered before the event leaves), and on: the connection is refused or times out while connecting. Other calls keep their retries.
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.
Problem
POST /webhook-endpoints/{id}/testsends a realwebhook.testevent and the API accepts but ignores itsIdempotency-Key(see the route description in the OpenAPI), so the client's automatic retry on 502, 503, 504 or a network error could send a second event.Change
The call is retried on a 429 only (answered before the event leaves), plus on: the connection is refused or times out while connecting. Every other call keeps its current retries. A test covers each case.
Tests
Unit tests of the retry policy: no replay after 500, 502, 503, 504 or a lost connection; replay after a 429; other calls still retried on 503.