magento / inventory

Magento Inventory Project (a.k.a MSI)
Open Software License 3.0
336 stars 247 forks source link

Product is oversold when multiple people purchase same product at the same time #3072

Open secomm-dev opened 4 years ago

secomm-dev commented 4 years ago

Preconditions (*)

  1. Magento 2.3.x
  2. A product with QTY = 1, Saleable-QTY = 1
  3. Any payment method, any shipping method
  4. Any environment (standard LAMP following Magento recommendation)

Steps to reproduce (*)

  1. Multiple people add the product into cart. E.g. 10 people working on 10 different devices
  2. Proceed to Checkout
  3. Enter all required information: shipping address, shipping method, payment method
  4. At the very same time (millisecond), all people hit Submit button

Expected result (*)

  1. Only 1 Order should be created
  2. QTY remains 1
  3. Saleable-QTY becomes 0

Actual result (*)

  1. Multiple orders are created (it's a random number, but definitely more than 1)
  2. QTY remains 1
  3. Saleable-QTY becomes a negative number which equal to the number of orders that should have not been created (but have been)

Additional Information


Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

m2-assistant[bot] commented 4 years ago

Hi @secomm-dev. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


smoskaluk commented 4 years ago

Hi @secomm-dev! This issue will be fixed by PR https://github.com/magento/inventory/pull/3046