-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(webhooks): allow manually retrying delivery of outgoing webhooks #4176
Conversation
0ebb4a0
to
4836467
Compare
4836467
to
2b87e2f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auth specific changes looks fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
regenerate open-api specs other than that LGTM!
…o find merchant account and business profile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Type of Change
Description
This PR includes changes in the outgoing webhooks flow to allow manually retrying webhook deliveries, and adds an API endpoint for the same.
/events/{merchant_id_or_profile_id}/{event_id}/retry
Additional Changes
This PR adds a new endpoint to retry outgoing webhook delivery.
Motivation and Context
This allows users to debug issues in case the delivery of webhooks to their application server fails, without having to wait for the application to automatically retry at set intervals.
How did you test it?
This PR adds a new endpoint and testing it is pretty straightforward. It can be tried out using a request like so:
In case of errors hitting the merchant server (say URL is inaccessible):
Note:
initial_attempt_id
would not contain theevent_id
of the event being retried, but theinitial_attempt_id
of the event being retried. This would allow us to list all attempts including manual delivery attempts related to the initial attempt.delivery_attempt
ismanual_retry
in this caseresponse.error_message
is non-nullSuccessful delivery:
The above request should behave the same way by replacing the profile ID with the merchant ID, or replacing the
api-key
header and value with the JWT token received after user sign in.Checklist
cargo +nightly fmt --all
cargo clippy