Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grouped product indexer | cache clear fix #3402

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

adarshkhatri
Copy link

Preconditions (*)

  1. magento/module-inventory-cache
  2. Magento 2.4.7-p2

What is happening?

MSI has this function in place as around method. Which gets the product IDs from inventory_stock_ID table before and after.
Pay attention to around method here.

public function aroundExecuteList(Sync $subject, callable $proceed, array $stockIds)

Then, it also has this function as after method to index grouped products, which happens after the above function (around) runs, meaning at this time, the system has already sent all the grouped product IDs to clear the cache.

What this means?

If I have 200 grouped products in my system, every time a single product's (not related to grouped whatsoever) sources deleted/added, then it will send the cache clear request for this product PLUS that 200 grouped products.

Steps to reproduce (*)

  1. Make sure you have some grouped products
  2. Run bin/magento indexer:reindex inventory

Expected result (*)

  1. System should only send impacted products to clear the cache

Actual result (*)

  1. System should never send unrelated product to clear the cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Ready for Review
Development

Successfully merging this pull request may close these issues.

2 participants