magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Issue #13952 - Duplicate orders with same Quote Id at same time with few time difference.

Open fiko opened this issue 3 years ago • 33 comments

Description (*)

Two different orders have been placed with very few seconds as time difference with same quote Id.

Fixed Issues (if relevant)

  1. Fixes magento/magento2#13952

Manual testing scenarios (*)

  1. Login as a User
  2. Add items to cart and proceed through checkout.
  3. Select Any payment method. Not click on place order button
  4. Now login to the same account in another system.
  5. And proceed to checkout with the same items. Not click on place order button.
  6. Now you have to click on place order at the same time with both the systems.
  7. one of the screen must return failed image

Contribution checklist (*)

  • [x] Pull request has a meaningful description of its purpose
  • [x] All commits are accompanied by meaningful commit messages
  • [x] All new or changed code is covered with unit/integration tests (if applicable)
  • [x] README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • [ ] All automated tests passed successfully (all builds are green)

Resolved issues:

  1. [x] resolves magento/magento2#35833: Issue #13952 - Duplicate orders with same Quote Id at same time with few time difference.

fiko avatar Feb 25 '22 01:02 fiko

Hi @fiko. Thank you for your contribution Here are some useful tips how you can test your changes using Magento test environment. Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

:exclamation: Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s) For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here

:information_source: Run only required test builds during development. Run all test builds before sending your pull request for review.

For more details, review the Magento Contributor Guide documentation.

:warning: According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] avatar Feb 25 '22 01:02 m2-assistant[bot]

@magento give me test instance

fiko avatar Feb 25 '22 04:02 fiko

Hi @fiko. Thank you for your request. I'm working on Magento instance for you.

Hi @fiko, here is your Magento Instance: https://3022acaf10e15efc772e887049d276eb.instances.magento-community.engineering Admin access: https://3022acaf10e15efc772e887049d276eb.instances.magento-community.engineering/admin_debe Login: 31e52b8b Password: 0b4613ea7fdb

@magento run Database Compare, Static Tests

fiko avatar Mar 03 '22 08:03 fiko

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@magento run all tests

fiko avatar Mar 03 '22 09:03 fiko

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@magento run Functional Tests CE, Functional Tests EE, Functional Tests B2B

fiko avatar Mar 04 '22 01:03 fiko

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@magento run Integration Tests

fiko avatar May 16 '22 13:05 fiko

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@ihor-sviziev Why this ticket is not being taken seriously, The problem is still happening in active Magento installations

amine-y avatar Jul 27 '22 13:07 amine-y

@sidolov @sdzhepa, could you take a look, and reply?

ihor-sviziev avatar Jul 27 '22 14:07 ihor-sviziev

Hello @amine-y and @ihor-sviziev

Thank you for raising this issue!

I do not know the reason but looks like this PR was missed because the related issue was closed: https://github.com/magento/magento2/issues/13952

The issue has a huge thread of comments as I can see a patch was provided to fix it: https://github.com/magento/magento2/issues/13952#issuecomment-711439385. But the overall situation is not clear is it actual for the current 2.4-develop

@engcom-Alfa and @engcom-Charlie Could you please work together to investigate this problem? Please review in detail the discussion/comments in https://github.com/magento/magento2/issues/13952 Try to reproduce this issue by the steps from this PR. Try to check if the patch fixes the issue If the problem still exists please create and confirm the new issue with all required details. Also please link a new issue with this PR and add all other links to comments if required

Depending on the result please process the PR accordingly cc: @sidolov

sdzhepa avatar Jul 27 '22 17:07 sdzhepa

@magento give me test instance

engcom-Alfa avatar Jul 28 '22 06:07 engcom-Alfa

Hi @engcom-Alfa. Thank you for your request. I'm working on Magento instance for you.

Hi @engcom-Alfa, here is your Magento Instance: https://3022acaf10e15efc772e887049d276eb.instances.magento-community.engineering Admin access: https://3022acaf10e15efc772e887049d276eb.instances.magento-community.engineering/admin_51fe Login: a5f0caef Password: a5f1cd350e6f

@magento give me 2.4-develop instance

engcom-Alfa avatar Jul 28 '22 07:07 engcom-Alfa

Hi @engcom-Alfa. Thank you for your request. I'm working on Magento instance for you.

Hi @engcom-Alfa, here is your Magento Instance: https://a6a861c85f57f6dcaba7f9881ce91f59.instances.magento-community.engineering Admin access: https://a6a861c85f57f6dcaba7f9881ce91f59.instances.magento-community.engineering/admin_2bef Login: 86114682 Password: 368be3a85fb8

@magento create issue

engcom-Alfa avatar Jul 28 '22 07:07 engcom-Alfa

@magento run all tests

engcom-Alfa avatar Jul 28 '22 07:07 engcom-Alfa

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

Hi @ihor-sviziev , @fiko I have tried to reproduce this issue and 2.4-develop instance and it is reproducible. Below are the steps I followed.

  1. Used above Magento instance, and created a frontend customer, added address as well.
  2. With one firefox default browser, logged into the same customer and added a product to the cart.
  3. Opened another private browser and logged into the same customer. Placed both the browsers on the same screen.
  4. Click on proceed to checkout and with shipping method, moved to payment page (Did do the same from both the browsers'm logged pages).
  5. Clicked on Place order buttons immediately once after other, where both the browser buttons are visible in the same system screen (as shown in below screenshot).

As defined, The issue is existing as shown in below screenshot image

I have pulled this PR changes and re-tested the same scenario. Got see the fix with proper error message as shown in the below screenshot. image

engcom-Alfa avatar Jul 28 '22 08:07 engcom-Alfa

Hi @ihor-sviziev Based on the above-comment, we can proceed forward with this ticket. Can you please help us with your code review on this. Thanks in advance!

engcom-Alfa avatar Jul 28 '22 08:07 engcom-Alfa

@magento run Unit Tests

fiko avatar Aug 07 '22 15:08 fiko

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@magento run WebAPI Tests

fiko avatar Aug 07 '22 17:08 fiko

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.