Skip to content

[Issue] Multiple clicks in massaction dropdown generates multiple post request #37997

@m2-assistant

Description

@m2-assistant

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.
image

Screenshot-2

image

Screenshot-3

Similarly, I clicked the "Update Attributes" action three times, leading to the generation of three POST requests.
image

Screenshot-4

image

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

No one assigned

    Labels

    Area: PerformanceComponent: HTTPIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneReported on 2.4.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions