Adyen / adyen-magento2

Adyen Payment plugin for Magento2
MIT License
155 stars 212 forks source link

Excessive calls (100+ per asset) to checkoutShopper assets #2766

Open SamJUK opened 2 days ago

SamJUK commented 2 days ago

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 to dfp.1.0.0.html fingerprintjs2.js risk.1.0.1.js. See attached Google Drive link for example

On 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:

  1. Navigate to checkout
  2. Wait for payment methods to load
  3. View Network tab and filter for checkoutShopper

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

Januszpl commented 23 hours ago

I can confirm reported issue. I will also add that opening 3DS modal take ages and take a lot of memory as well.

In our case it is related to version: version: 9.7.2

Screenshot 2024-10-09 at 02 48 21

Screenshot 2024-10-09 at 21 23 57
PeteBED commented 9 hours ago

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.

Januszpl commented 9 hours ago

@PeteBED are you using onestepcheckout or standard Magento2 checkout?

PeteBED commented 9 hours ago

@PeteBED are you using onestepcheckout or standard Magento2 checkout?

Using Amasty's one step checkout module.

SamJUK commented 9 hours ago

Just to note, we are also seeing the same issue on the v8 version of the plugin (Magento 2.4.4-p11) albeit to a lesser degree (minus the performance impact).

I assume this is because of the abstraction in v9 from adyen-hpp-method -> adyen-pm-method

image