vendure icon indicating copy to clipboard operation
vendure copied to clipboard

fix(default-search-plugin, elasticsearch-plugin) Adding StockMovement…

Open LeftoversTodayAppAdmin opened this issue 1 year ago • 3 comments

Adding StockMovementEvent to search

Description

Using ElasticSearch or the defaultsearch plugin as the search backend and when I use Stripe Plugin to successfully complete a purchase, the search index for that product variant is not updated. As a result, the search results still have the inStock value set to true and shows an out of stock item in the search results. The products API shows the correct stock level immediately after the transaction and when the stock is allocated.

https://github.com/vendure-ecommerce/vendure/issues/3066

Breaking changes

Does this PR include any breaking changes we should be aware of? No, it does not have any breaking changes.

Screenshots

You can add screenshots here if applicable. image image

Checklist

📌 Always: [✅] I have set a clear title [✅] My PR is small and contains a single feature [✅] I have checked my own PR

👍 Most of the time:

  • [ ] I have added or updated test cases
  • [ ] I have updated the README if needed

LeftoversTodayAppAdmin avatar Oct 06 '24 23:10 LeftoversTodayAppAdmin

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview Oct 6, 2024 11:38pm

vercel[bot] avatar Oct 06 '24 23:10 vercel[bot]

I have read the CLA Document and I hereby sign the CLA

LeftoversTodayAppAdmin avatar Oct 06 '24 23:10 LeftoversTodayAppAdmin

Summary of the issues during E2E testing:

  • There are 20 products in the node_modules/@vendure/elasticsearch-plugin/e2e/data/elasticsearch-plugin-uuid.e2e-spec.ts.sqlite file but only 15 of the products get loaded into ElasticSearch causing all the test cases to break. Similar issue with the node_modules/@vendure/elasticsearch-plugin/e2e/data/elasticsearch-plugin.e2e-spec.ts.sqlite file as well.
  • Unsure why all the available data is not getting loaded.
  • I even tried using ES ver 7.7 to ensure its well below the 7.10 upper limit version and it does not solve the issue.
  • As a workaround I have directly edited the plugin package using patch-package and I have tested it. It is fully working, see attached video.

https://github.com/user-attachments/assets/dfa7aa74-571d-4928-9401-1a080010be39

LeftoversTodayAppAdmin avatar Oct 08 '24 10:10 LeftoversTodayAppAdmin

I tested this locally and the e2e tests are all working just fine. I have no idea what was going wrong in CI.

Thanks for your contribution!

michaelbromley avatar Nov 08 '24 11:11 michaelbromley