magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.57k stars 9.32k forks source link

BUG [ORDERs][S1] : Create new order and edit exists in different browser tabs, produces cancellation and creation incrementid-1 #39315

Open mmaximo33 opened 3 weeks ago

mmaximo33 commented 3 weeks ago

Preconditions and environment

Steps to reproduce

Two cases were detected for which the same solution would apply.

Details

The problem is exclusively found in poor management of the incrementID of the order based on the QuoteSession data that takes as a reference the QuoteId of an existing order that is being edited after consolidating the new order.

Case A

Two actions will be used simultaneously in the same browser with the same Magento session, the creation of an order (Tab1) and the editing of an existing one (Tab2).

  1. Tab1: Go to Sales > Order > Create new Order
    • Select an existing customer or create a new one
    • Indicate the store
    • Observation
      • See that the title says CREATE NEW ORDER FOR CUSTOMER IN STORE
  2. Tab2: Go to Sales > Order
    • Open an order exist
    • Click on the edit button
    • Observation
      • See that the title is EDIT ORDER IncrementID
      • At this time the session data was created
  3. Tab1: To confirm the above refresh the tab
    • Summitee the new order
    • Create the new order
  4. Go to Sales > Order >
    • Find the incrementID of the order you were editing
    • Visualize that the one that was edited went to a canceled state
    • Visualize that the one that was created was generated with incrementID-1

Support with video for a better understanding of the problem

https://github.com/user-attachments/assets/8851722e-1aeb-4911-a555-cc6b6706366c

Expected result

The expected result would be that

Actual result

The current result is that

Case B

The same problem occurs if I try to edit two orders simultaneously

  1. Tab1: Go to Sales > Order

    • Open an order exist
    • Click on the edit button
    • Observation
      • See that the title is EDIT ORDER IncrementID (0001)
      • At this time the session data was created
  2. Tab2: Go to Sales > Order

    • Open an order exist
    • Click on the edit button
    • Observation
      • See that the title is EDIT ORDER IncrementID (0002)
      • At this time the session data was created
  3. Tab1: To confirm the above refresh the tab

    • See that the title is EDIT ORDER IncrementID (0002)
    • Reference was updated from 0001 to 0002

Expected result

The expected result would be that

Actual result

The current result is that

Additional information

This is directly related to the Quote session

Magento\Backend\Model\Session\Quote::getData()

This problem occurs more frequently when the sales team is large and operates with several customers at the same time, significantly increasing the probability of orders being created and edited simultaneously.

This problem affects the new general implementation and with the management of third-party extensions to add features it can affect the frontend

Release note

No response

Triage and priority

m2-assistant[bot] commented 3 weeks ago

Hi @mmaximo33. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.

m2-assistant[bot] commented 3 weeks ago

Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Bravo commented 2 weeks ago

Hi @mmaximo33,

Thanks for your reporting and collaboration.

We have verified the issue for both case1 and case2 in the Latest 2.4-develop instance and the issue is reproducible.Kindly refer the screenshots.

Screenshot 2024-11-06 at 10 02 50 Screenshot 2024-11-06 at 10 02 57 Screenshot 2024-11-06 at 10 05 05 Screenshot 2024-11-06 at 10 05 17 Screenshot 2024-11-06 at 10 06 52

The status of the order that was being edited (Tab2) is changed to canceled status.The new order is created with incrementID-1

Hence Confirming the issue.

Thanks.

github-jira-sync-bot commented 2 weeks ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-13312 is successfully created for this GitHub issue.

m2-assistant[bot] commented 2 weeks ago

:white_check_mark: Confirmed by @engcom-Bravo. Thank you for verifying the issue.
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.