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

Clear customer address registry on retrieving entities #9

Closed avstudnitz closed 2 months ago

avstudnitz commented 2 months ago

The CustomerAddressRepository uses a CustomerAddressRegistry 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.

Therefore, manually removing the entity from the registry should guarantee that it is always loaded from the database.

This is the same solution as used for the customer entity.