Using QuoteIdToMaskedQuoteId shouldn't increase response time #33676
Labels
Fixed in 2.4.x
The issue has been fixed in 2.4-develop branch
Issue: ready for confirmation
Priority: P2
A defect with this priority could have functionality issues which are not to expectations.
Progress: done
Severity: S1
Affects critical data or functionality and forces users to employ a workaround.
Projects
In the Klaviyo extension, we have a plugin that adds a masked quote id to quote search API requests. That looks like quite a small plugin that shouldn't cause any performance damage. But, by just commenting fetching masked quote ID - I noticed that performance is improved more than 2 times.
Here is a link to the plugin in Klaviyo extension (it uses API class, which is ok):
https://github.com/klaviyo/magento2-klaviyo/blob/3.0.5/Plugin/Api/CartSearchRepository.php
Detailed investigation shown that issue is coming from the following line:
magento2/app/code/Magento/Quote/Model/QuoteIdToMaskedQuoteId.php
Lines 50 to 53 in afa2169
Basically, that code fetches again all the quotes again, and all their quote items and so on just for... checking if such quote exists!
Preconditions (*)
Steps to reproduce (*)
Note: here is documentation on how to get access token https://devdocs.magento.com/guides/v2.4/get-started/authentication/gs-authentication-token.html#request-token
Expected result (*)
Actual result (*)
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
The text was updated successfully, but these errors were encountered: