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

fix: parent product cache not clearing #37528

Open
wants to merge 3 commits into
base: 2.4-develop
Choose a base branch
from

Conversation

adamzero1
Copy link
Contributor

@adamzero1 adamzero1 commented May 23, 2023

Description (*)

When a simple product has more then one parent, only one of the parents will have their cache cleared.

Related Pull Requests

Fixed Issues (if relevant)

N/A was unable to find an existing issue relating to this

Manual testing scenarios (*)

  1. Ensure MSI is disabled
  2. Ensure indexers are on "Update on schedule"
  3. Configure 2 simple products A & B, set them to both be in stock
  4. Configure 2 configurable products C & D, assign products A & B to both. (so you have 2 configurables, with 2 options)
  5. Visit the frontend for both the configurables. Both should have both options.
  6. Set product A to out of stock and save
  7. allow the indexer to run.
  8. Re-vist the frontend for both configurables.
    Expected: Both configurables should only have option B present
    Actual: One of the configurables will still have both A and B options available.

Additional Notes
Saving the broken configurable will clear cache so the issue is "fixed".

Questions or comments

I was hoping to write a unit test for this, but given how much of the class is private methods and also direct SQL queries (with no middle class) it would make it very difficult.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Resolved issues:

  1. resolves [Issue] fix: parent product cache not clearing #37530: fix: parent product cache not clearing

Sorry, something went wrong.

@m2-assistant
Copy link

m2-assistant bot commented May 23, 2023

Hi @adamzero1. Thank you for your contribution!
Here are some useful tips on how you can test your changes using Magento test environment.

Add the comment under your pull request to deploy test or vanilla Magento instance:
  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@engcom-Hotel
Copy link
Contributor

@magento create issue

@engcom-Hotel engcom-Hotel added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label May 23, 2023
@mrtuvn mrtuvn added Component: CatalogInventory Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests labels May 24, 2023
@mrtuvn
Copy link
Contributor

mrtuvn commented May 24, 2023

Could you cover changes with some test cases ? Thanks you

@engcom-Hotel
Copy link
Contributor

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@engcom-Hotel
Copy link
Contributor

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

Copy link
Contributor

@engcom-Hotel engcom-Hotel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @adamzero1,

Thanks for the contribution!

Please cover the changes with some automated tests.

Thanks

Copy link
Contributor

@engcom-Hotel engcom-Hotel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @adamzero1,

Is the issue reproducible with MSI enabled? If not then I think we should not fix this because we recommend all our merchants to enable the MSI.

Thanks

@hostep
Copy link
Contributor

hostep commented Jun 3, 2023

@engcom-Hotel: I beg to differ

We've been trying out MSI many times, and always came to the conclusion that it's not stable yet to be used in production environments (products that should be in stock are out of stock, products that should be out of stock are in stock, after a shop had been running for a few months with MSI enabled). So we have it almost everywhere disabled for our clients.

It would still be beneficial to keep getting bugfixes for non-MSI installations out there in my opinion.

@adamzero1
Copy link
Contributor Author

Apologies on the delay, I agree with @hostep , MSI isn't stable enough for the majority of our clients.
I will do my best to get some test coverage soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests Component: CatalogInventory Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: needs update
Projects
Status: Changes Requested
Development

Successfully merging this pull request may close these issues.

[Issue] fix: parent product cache not clearing
4 participants