-
Notifications
You must be signed in to change notification settings - Fork 213
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
[ECP-9154][ECP-9491] Excessive calls (100+ per asset) to checkoutShopper assets #2766
Comments
We originally thought this was part of the module update to 9.9.1 as we saw it first on our UAT environment. However today we're seeing this on production with version 9.5.2. Is this functionality pulled in dynamically by Adyen? It causes crashes in iOS Safari and customers are leaving the site frustrated so it's critical for us to understand the issue. We're generating so many requests that Adyen is responding with HTTP 429. |
@PeteBED are you using onestepcheckout or standard Magento2 checkout? |
Using Amasty's one step checkout module. |
I can confirm that we're also encountering the same issue, which we only noticed during testing on Safari due to slow loading. This problem has also been previously reported here: #2581. There is a temporary workaround to disable risk collection, but no permanent solution is available at this time. |
All Config/Simple products here, no Virtual |
Thank you @PeteBED. Let me try to reproduce the issue. I will get back to you soon. |
I would say disabling the risk checks is a valid short term workaround, although I am still keen on a proper resolution. As the risk checks provide important functionality, especially heading into the Sales Period (Black Friday, Christmas, New Year etc). Where it is not uncommon to seem a rise in carding attacks. |
@candemiralp is there anything unique to the Would creating a hash of the available paymentMethodsResponse, and storing it in a global context be a bit more of a robust workaround that would still allow risk checks to take place? Something like below, it seems to work in a local environment. --- vendor/adyen/module-payment/view/frontend/web/js/model/adyen-checkout.js
+++ vendor/adyen/module-payment/view/frontend/web/js/model/adyen-checkout.js
@@ -21,7 +21,14 @@
return {
buildCheckoutComponent: function (paymentMethodsResponse, handleOnAdditionalDetails, handleOnCancel = undefined, handleOnSubmit = undefined) {
if (!!paymentMethodsResponse.paymentMethodsResponse) {
- return AdyenCheckout({
+
+ const checkoutContextKey = Object.keys(paymentMethodsResponse.paymentMethodsResponse).join('');
+ window.adyenCheckoutContexts = window.adyenCheckoutContexts || {};
+ if (window.adyenCheckoutContexts.hasOwnProperty(checkoutContextKey)) {
+ return window.adyenCheckoutContexts[checkoutContextKey];
+ }
+
+ return window.adyenCheckoutContexts[checkoutContextKey] = AdyenCheckout({
locale: adyenConfiguration.getLocale(),
clientKey: adyenConfiguration.getClientKey(),
environment: adyenConfiguration.getCheckoutEnvironment(),
|
Hello @SamJUK, I wouldn't follow this approach as some payment methods might override the default event callbacks such as Please check the following comment. Best Regards, |
Hello All, Thank you for your patience. We have introduced a POC to this issue and are looking forward for some pilot tests. Could you please share your insights on the PR #2770? Best Regards, |
Thanks for getting through this so quickly Can! |
Hello @SamJUK, Thank you for testing it out. We are looking forward to hearing from you. Best Regards, |
Describe the bug
The checkout is making an excessive amount of network requests to the
https://checkoutshopper-test.adyen.com/checkoutshopper/assets/...
domain. We are seeing over 100 requests each todfp.1.0.0.html
fingerprintjs2.js
risk.1.0.1.js
. See attached Google Drive link for exampleOn Safari this is causing a long running loader and a flood of console errors from
fingerprintjs2.js
There are too many active WebGL contexts on this page, the oldest context will be lost.
And on Chrome similar network activity without the console spam / long running loader.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A single request for each checkoutShopper asset.
Magento version
2.4.6-p8
Plugin version
9.9.1
Screenshots
https://drive.google.com/file/d/1SMHvnWSeVb1_uUu2kl2iAn0mXvQVNXuF/view?usp=sharing
Desktop (please complete the following information):
Additional context
From an initial quick look, it appears we are accidentally building the checkout component for every payment method instead of just once.
Placing a breakpoint on the subscribe method shows a subscription being bound for every payment method (101 times), even if they are not used on the merchants account.
If you place a breakpoint on the
createCheckoutComponent
method, you can step through and switch to the network tab and see another set of the js files being loaded.https://github.com/Adyen/adyen-magento2/blob/main/view/frontend/web/js/view/payment/method-renderer/adyen-pm-method.js#L71
https://github.com/Adyen/adyen-magento2/blob/main/view/frontend/web/js/view/payment/method-renderer/adyen-pm-method.js#L86
https://github.com/Adyen/adyen-magento2/blob/main/view/frontend/web/js/view/payment/method-renderer/adyen-pm-method.js#L86
The text was updated successfully, but these errors were encountered: