-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
This issue is automatically created based on existing pull request: #37996: Multiple clicks in massaction dropdown generates multiple post request
Preconditions (*)
Tested on this versions:
1. Magento 2.4.5-p1
2. Magento 2.4.6-p1
3. Magento 2.4.6-p2
Description (*)
When we go to the Sales section, specifically the Orders page in Magento 2, and select an order, you have the option to perform actions in bulk, which we call "mass actions." For example, let's say I click the "Hold" action twice. This action triggers two POST requests, which are recorded in the Apache access log (screenshots 1 and 2). Now, if you were to click any action three times, it would result in the generation of three simultaneous POST requests. This behavior isn't limited to the Sales Orders page. It applies to other areas in Magento 2 as well. For instance, if you're working with the product grid and perform a mass action there, like clicking "Update Attributes" three times, it generates three POST requests. You can see these requests in the screenshots I’ve shared (3 and 4). In simpler terms, when you use mass actions in Magento 2, like holding orders or updating product attributes, multiple requests can be sent to the server simultaneously if you click the action multiple times quickly. This behavior can be observed not only in the Sales Orders section but also in other parts of the system, leading to multiple requests being processed at the same time.
Screenshot-1
I clicked the "Hold" action twice in the order grid, resulting in the generation of two POST requests.
Screenshot-2
Screenshot-3
Similarly, I clicked the "Update Attributes" action three times, leading to the generation of three POST requests.
Screenshot-4
Consequences
In our scenario, we have a module that handles the creation of shipments through a mass action. While there is a safeguard in place to check for existing shipments during the creation process, the issue arises when users repeatedly click the action, triggering multiple POST requests. This can inadvertently result in the generation of multiple shipments, the actual quantity of items shipped may be lower than the salable quantity.
Contribution checklist (*)
- Pull request has a meaningful description of its purpose
- All commits are accompanied by meaningful commit messages
- All new or changed code is covered with unit/integration tests (if applicable)
- 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)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status