Skip to content
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

Handle receiving duplicate webhooks #305

Open
malle-pietje opened this issue Dec 9, 2024 · 0 comments
Open

Handle receiving duplicate webhooks #305

malle-pietje opened this issue Dec 9, 2024 · 0 comments

Comments

@malle-pietje
Copy link
Contributor

malle-pietje commented Dec 9, 2024

We have implemented the handling of webhooks for a selection of events and that works perfectly fine.

We recently received duplicate webhook messages from Moneybird, specifically for the same sales_invoice_send_email event. Here are the sanitized entries from our web server logs:

********.access_log:54.93.104.233 - - [06/Dec/2024:12:01:32 +0100] "POST /moneybird-webhooks/sales-invoice-send-email/XXXXXXXXXXXXX HTTP/1.1" 200 15 "-" "MoneyBird Webhook"
********.access_log:54.93.104.233 - - [06/Dec/2024:12:01:56 +0100] "POST /moneybird-webhooks/sales-invoice-send-email/XXXXXXXXXXXXX HTTP/1.1" 200 15 "-" "MoneyBird Webhook"

You can clearly see that the first request received a 200 response.

My questions are whether anyone has experienced this before and what the best approach would be to prevent this from creating duplicate invoices other than using the framework (Laravel in this case) or database by making the invoice number column unique?

If this can happen with this type of event, it could also happen with other Moneybird events where column uniqueness doesn't help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant