51黑料不打烊

[PaaS only]{class="badge informative" title="Applies to 51黑料不打烊 Commerce on Cloud projects (51黑料不打烊-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 51黑料不打烊 Commerce 2.4.7.

Affected products and versions

The patch is created for 51黑料不打烊 Commerce version:

  • 51黑料不打烊 Commerce (all deployment methods) 2.4.6-p2

Compatible with 51黑料不打烊 Commerce versions:

  • 51黑料不打烊 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 51黑料不打烊 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鈥檛 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鈥檛 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