ÃÛ¶¹ÊÓÆµ

[PaaS only]{class="badge informative" title="Applies to ÃÛ¶¹ÊÓÆµ Commerce on Cloud projects (ÃÛ¶¹ÊÓÆµ-managed PaaS infrastructure) and on-premises projects only."}

ACSD-57477: Sales rule processing slows performance on cart-related requests

The ACSD-57477 patch fixes the issue where sales rule processing causes slow performance on cart-related requests. This patch is available when the Quality Patches Tool (QPT) 1.1.69 is installed. The patch ID is ACSD-57477. Please note that this issue is scheduled to be fixed in ÃÛ¶¹ÊÓÆµ Commerce 2.4.7.

Affected products and versions

The patch is created for ÃÛ¶¹ÊÓÆµ Commerce version:

  • ÃÛ¶¹ÊÓÆµ Commerce (all deployment methods) 2.4.6-p2

Compatible with ÃÛ¶¹ÊÓÆµ Commerce versions:

  • ÃÛ¶¹ÊÓÆµ Commerce (all deployment methods) 2.4.6 - 2.4.6-p11
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your ÃÛ¶¹ÊÓÆµ Commerce version, update the magento/quality-patches package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.

Issue

Sales rule processing causes slow performance on cart-related requests if you send the parameters as GraphQL variables.

Steps to reproduce:

  1. Add 1000 product attributes.

  2. Create a cart using below GraphQL query.

    code language-none
    mutation {createEmptyCart}{noformat}
    
  3. Add a product to cart using below GraphQL query.

    code language-none
    mutation AddProductsToCart($cartId: String!, $products: [CartItemInput!]!) {
        addProductsToCart(cartId: $cartId, cartItems: $products) {
          cart {
            id
            __typename
          }
          __typename
        }
      }
    
  4. Set these Variables.

    code language-none
    {
      "cartId": "id_here",
      "products": [
        {
          "sku": "product_dynamic_1",
          "parent_sku": "product_dynamic_1",
          "quantity": 1
        }
      ]
    }
    
  5. This issue occurs only when you send the parameters as GraphQL variables. If you include the parameters into the GraphQL query itself, then this issue doesn’t occur.

  6. Send the same Add To Cart request after adding parameters into the GraphQL query itself.

    code language-none
    mutation {
     addProductsToCart(
       cartId: "id_here"
       cartItems:  [
        {
          sku: "product_dynamic_1",
          parent_sku: "product_dynamic_1",
          quantity: 1
        }
      ]
     ) {
       cart {
            id
            __typename
          }
          __typename
     }
    }
    

Expected results:

The AddProductsToCart GraphQL operation performance shouldn’t be degraded.

Actual results:

The AddProductsToCart GraphQL operation performance degrades, because it loads all product attributes when parameters are sent as variables.

Apply the patch

To apply individual patches, use the following links depending on your deployment method:

To learn more about Quality Patches Tool, refer to:

recommendation-more-help
c2d96e17-5179-455c-ad3a-e1697bb4e8c3