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

Vouchers can be reused under concurrent checkout #2101

Closed
TWarszawski opened this Issue Aug 17, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@TWarszawski
Copy link

TWarszawski commented Aug 17, 2016

When two customers check out concurrently using a voucher that should only be able to be used once by one customer, the voucher can be used twice.

Steps to reproduce:

  1. Start sandbox, create two customers, create/pick test product, create test voucher with usage setting “can be used once by one customer”.
  2. Both customers add the item to their baskets, apply the voucher, and perform the checkout concurrently, making sure both customers finish checkout (click the Place Order button) as close to the same time as possible.

We have reproduced this behavior on a single machine, by performing the above steps in rapid succession with one customer in one browser window and another customer in a second browser window.

Expected Result:
Only one checkout successfully completes using the voucher.

Actual Result:
Both checkouts successfully complete using the voucher.

mvantellingen added a commit that referenced this issue Mar 31, 2017

Fix a race condition when using single-usage vouchers
The initial check if the voucher is available was done before creating
the order. This change adds a validation step during the order creation
within an atomic() block.

See #2101

mvantellingen added a commit that referenced this issue Mar 31, 2017

Fix a race condition when using single-usage vouchers
The initial check if the voucher is available was done before creating
the order. This change adds a validation step during the order creation
within an atomic() block.

See #2101

mvantellingen added a commit that referenced this issue Mar 31, 2017

Fix a race condition when using single-usage vouchers
The initial check if the voucher is available was done before creating
the order. This change adds a validation step during the order creation
within an atomic() block.

See #2101

mvantellingen added a commit that referenced this issue Apr 6, 2017

Fix a race condition when using single-usage vouchers
The initial check if the voucher is available was done before creating
the order. This change adds a validation step during the order creation
within an atomic() block.

See #2101

mvantellingen added a commit that referenced this issue Apr 15, 2017

Fix a race condition when using single-usage vouchers
The initial check if the voucher is available was done before creating
the order. This change adds a validation step during the order creation
within an atomic() block.

See #2101

mvantellingen added a commit that referenced this issue Apr 15, 2017

Fix a race condition when using single-usage vouchers
The initial check if the voucher is available was done before creating
the order. This change adds a validation step during the order creation
within an atomic() block.

See #2101
@sasha0

This comment has been minimized.

Copy link
Member

sasha0 commented Apr 18, 2017

Fixed in 8fb5ce9

@sasha0 sasha0 closed this Apr 18, 2017

MrVoltz pushed a commit to EndevelCZ/django-oscar that referenced this issue Aug 21, 2018

Fix a race condition when using single-usage vouchers
The initial check if the voucher is available was done before creating
the order. This change adds a validation step during the order creation
within an atomic() block.

See django-oscar#2101
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment