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

DefaultSearchPlugin: Product can be falsely indexed as in stock if a deleted variant has stock #3109

Closed
kyunal opened this issue Oct 5, 2024 · 0 comments · Fixed by #3110
Labels
P3: minor Non-critical, no workarounds exist type: bug 🐛 Something isn't working @vendure/core
Milestone

Comments

@kyunal
Copy link
Contributor

kyunal commented Oct 5, 2024

Describe the bug
Consider a product with multiple variants where one variant, that had stock, was deleted after some time. The DefaultSearchPlugin will falsely index that the product is in stock as it does not pay attention to the soft-deleted variant.

To Reproduce
Steps to reproduce the behavior:

  1. Create a product with multiple variants, put one in stock that you intend to soft delete
  2. Delete said variant
  3. According to the DefaultSearchPlugin the product is falsely in-stock

Expected behavior
The product should be shown out of stock and the deleted variant should be disregarded

Environment (please complete the following information):

  • @vendure/core version: 2.3.0 but I found that this affects later versions too
  • Nodejs version 18
  • Database (mysql/postgres etc): postgres 16

Additional context
I will PR this later in the day

@kyunal kyunal added the type: bug 🐛 Something isn't working label Oct 5, 2024
@michaelbromley michaelbromley added this to the v3.0.5 milestone Oct 8, 2024
@michaelbromley michaelbromley moved this to 📅 Planned in Vendure OS Roadmap Oct 8, 2024
@michaelbromley michaelbromley added @vendure/core P3: minor Non-critical, no workarounds exist labels Oct 8, 2024
@michaelbromley michaelbromley moved this from 📅 Planned to 💯 Ready in Vendure OS Roadmap Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3: minor Non-critical, no workarounds exist type: bug 🐛 Something isn't working @vendure/core
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants