[Race condition] PrestaShop Checkout v9.5.1.0 duplicate status "Payment received" #1464
Replies: 3 comments 2 replies
|
I have the exact same problem since update to 5.1.0 (7.5.1.0 on PS 1.7.7.8), it happen when customer pay by Paypal, but not all the time. |
|
Hi, We investigated this issue in depth and found the root cause: a race condition between concurrent requests. When a customer pays with PayPal, 3 requests arrive simultaneously:
Confirmed via nginx access logs: Another example: The All three paths converge on
Workaround: Add // controllers/front/DispatchWebHook.php - display() method
$logger->info("Webhook dispatch initiated");
// Workaround: sleep to avoid race condition with /module/ps_checkout/validate
sleep(3);Proper fix: A file lock ( Note: PR 1471 addresses the idempotency of the PayPal capture API call ( Same root cause as discussion 1451 and discussion 1430. cc @matks |
|
Hello I have good news 😄 We have published a new version v5.2.0 which should strongly mitigate the race condition issue thanks to a fix on API side. There are still things to improve on module side but the mitigation should be very efficient I believe. @louisbels we are considering the idea of relying on multiple locks solutions because we know on some hosting environments the flock won't work, on some other environments a database entre won't be efficient... so instead of trying to find "the fix that works in every environment" we might have multiple solutions and allow merchants/developers to pick. |
Uh oh!
There was an error while loading. Please reload this page.
I have a problem with the PrestaShop Checkout Module v9.5.1.0 under PrestaShop 9.02. When paying with PayPal, the status "Payment received" is set or triggered twice. As a result, the customer receives the confirmation from our shop twice and also receives the PayPal email twice. However, the payment was definitely made only once. Another problem is that the PDF invoice is not generated automatically.
All reactions