Open htdat opened 2 years ago
4858048-zen appears to be experiencing this issue. They are using WooCommerce Payments Subscriptions and are seeing duplicated order notes and email notifications for single payment events.
Labeling as high priority
in case there's something that we can tidy up here.
Next step: timeboxed investigation and log any specific follow up if needed.
Description
Similar to https://github.com/Automattic/woocommerce-payments/issues/3814 and with more reasoning in this comment https://github.com/Automattic/woocommerce-payments/issues/3814#issuecomment-1066691553, we'd like to ensure that if somehow the same webhook event is processed multiple times, it does not cause duplicate actions, for example, updating order status or adding notes in the order management page.
Acceptance criteria
invoice.*
- code ref) and see if they can cause duplicate actions.Dev notes
An approach used in this PR https://github.com/Automattic/woocommerce-payments/pull/3975 is to check if a specific order note exists with
WC_Payments_Order_Service::order_note_exists
. We only allow processing data if the note does not exist.Additional context
cc @Automattic/helix