Open steven-hoffman-jomashop opened 1 day ago
Hi @steven-hoffman-jomashop ,
Does this manifest in the shopper's experience somehow, and if so, could you please provide an example? e.g., duplicated quotes, cart being emptied unexpectedly, etc. A few more details would help us debug and remediate more effectively.
Thanks, Spencer
Hi @sgabhart22,
This would not 'manifest' to the customer; aside from a slower response time. The issue is that the caching logic does not 'consider' a null response as a 'cachable' response. As such the caching logic does not handle a missing 'customer link' and will repeat the query to the database if the same customer model is requested again.
In Summary, this is a performance issue, not a bug in 'behavior'.
What I expected
For
Amazon\Pay\Model\CustomerManagement::setAmazonIdExtensionAttribute
:$this->customerLinkManagement->getByCustomerId($customer->getId());
is only called once (Per customer).What happened instead
$this->customerLinkManagement->getByCustomerId($customer->getId());
returns an empty object$amazonCustomer->getId()
as false$this->amazonId
remains nullSteps to reproduce the issue
Call into
Amazon\Pay\Model\CustomerManagement::setAmazonIdExtensionAttribute
multiple times.Possible Fix
Your setup