mage-os / mageos-common-async-events

This module implements the most common events like order creation or customer change for the Mage-OS Asynchronous Events module.
MIT License
6 stars 2 forks source link

Customer registry caching #2

Closed avstudnitz closed 9 months ago

avstudnitz commented 10 months ago

The CustomerRepository uses a CustomerRegistry which will cache entities on load. If the updates happen in a different thread, there is a possibility that stale data is returned. However, we still want to use the repository instead of using the resource model to preserve modifications added by plugins.

There are two solutions to this

Please see https://github.com/aligent/magento2-default-async-events/pull/1#discussion_r904450099

https://github.com/aligent/magento2-default-async-events/blob/54c2943b0f08a31e56527a5c21e90f259c7d9db0/Model/AsyncCustomerManagement.php#L39