fix(default-search-plugin, elasticsearch-plugin) Adding StockMovement…
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.
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
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 |
I have read the CLA Document and I hereby sign the CLA
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
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!