medusajs / medusa

The world's most flexible commerce platform.
https://medusajs.com
MIT License
25.98k stars 2.61k forks source link

Inventory Changes not appearing #8426

Closed srihari20031 closed 1 month ago

srihari20031 commented 3 months ago

Bug report

When updating the inventpry quantity of product variants via POST request, the requests is successful and the changes appear in the database, but the get request shows no changes in the inventory quantity (it is 0), and on subsequent POST requests, the new product variant update is present while the previous variant quantity is set to 0.

System information Medusa version (including plugins): Latest(v1.20.9) Node.js version: v18.20.4 Database: Postgresql

Steps to reproduce the behavior

First install inventory module, and stock locations module than perform these,

Send a POST request to update a product variant at: http://localhost:9000/admin/products/prod_01J46QD53800T34M882HZ9T8EK

The request will be success and it will show the inventory quantity as in the below screenshot Screenshot from 2024-08-03 14-20-20

Send a GET request to get the product details at: http://localhost:9000/admin/products/prod_01J46QD53800T34M882HZ9T8EK

The request will be success and it will show the inventory quantity as 0 for the previously updated variant as in the below screenshot Screenshot from 2024-08-03 14-23-37

Verify that the changes appear in the database Send another POST request to update the same or a different variant Observe that the new update is present, but the previously updated variant's quantity is now 0

Expected behavior All product variant updates should persist in the database, and subsequent updates should not reset previous variants' quantities to 0. Screenshots Screenshot from 2024-08-03 14-50-07 Screenshot from 2024-08-03 14-51-30

Additional context The issue appears to be in the GET method, as the POST method successfully updates the database initially. However, the problem manifests when making subsequent POST requests. There are no internal server errors reported.

https://github.com/user-attachments/assets/d8dceb36-1d09-4030-86c6-d6506e39a455

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 3 days.

github-actions[bot] commented 1 month ago

This issue was closed because it has been stalled for 3 days with no activity.