Closed samuelbsource closed 3 years ago
Hello,
We're currently in the process of addressing this, so thank you for bringing the issue to our attention.
A few questions so we can effectively address this:
All the best,
Luke
Hi
Further information on this issue:
Steps to replicate:
SELECT main_table.* FROM sales_payment_transaction AS main_table
If you're a merchant with millions of previous orders you will have millions of records in the sales_payment_transaction table this will load all existing transactions regardless of if they related to this customer or not.
Thank you both for the info.
@iancassidyweb In your steps to replicate, you say "Register for a customer account", is this only happening for a new account?
@instalab Was there any common theme with the unaffected accounts?
FYI: we are currently removing TransactionSearchResultInterface
and replacing it for a more performant variation as suggested.
Hi @iancassidyweb @instalab would you be able to get back to us on Luke's questions?
Hello, one of my clients that uses this module reported that since updating it to the latest version logged in users can no longer access the checkout. After investigating the logs I've found out that PHP is being killed by the memory limit error, increasing the limit to very large values like 8GB did not fix the issue. After some digging into the code I've managed to pinpoint the source of this error which is the following method: \CheckoutCom\Magento2\Model\Service\TransactionHandlerService::getTransactions
This part specifically:
$this->transactionSearch
has a type ofTransactionSearchResultInterfaceFactory
The problem isTransactionSearchResultInterface
does not have such a method asaddOrderIdFilter()
, but because it's a DataObject no error is reported. The result of this call is that every single transaction that exists in the database is returned, and this is a big problem if you have millions of transactions in your database. Even if you don't have millions of transactions this code here is a performance bottleneck.TransactionSearchResultInterface
is not a very good way of getting the desired data either.A good way to handle this would be use the
$this->transactionRepository
variable which is the transaction repository, and search for transactions withMagento\Framework\Api\SearchCriteria
.