{"data":{"id":"ACSD-53148","source":"qpt","sourceRef":"magento/quality-patches@1.1.84","title":"Fixes the issue where two parallel requests in GraphQL for adding the same configurable product to the cart resulted in two separate items on the cart with the same product SKU.","categories":["GraphQL","Shopping Cart"],"components":["magento/module-configurable-product-graph-ql"],"origin":"adobe-commerce-support","documentation":{"url":"https://experienceleague.adobe.com/en/docs/commerce-operations/tools/quality-patches-tool/patches-available-in-qpt/v1-1-37/acsd-53148-two-requests-in-graphql-for-adding-the-same-configurable-product","path":"help/tools/quality-patches-tool/patches-available-in-qpt/v1-1-37/acsd-53148-two-requests-in-graphql-for-adding-the-same-configurable-product.md","blobSha":"b3254e545d8411b993b7ff84be04dd5b106c8e2c","description":"Two parallel requests in GraphQL for adding the same configurable product to the cart resulted in two separate items on the cart with the same product SKU.","stepsToReproduce":"1. Create a configurable product with SKU Test and a simple product with SKU Test-A. 1. Create a new empty cart via GraphQL (change the location with your own URL): curl --location 'http://mag.local/graphql' \\ --header 'Store: default' \\ --header 'Content-Type: application/json' \\ --data '{\"query\":\"mutation{\\n createEmptyCart\\n}\",\"variables\"{}}' 1. Run two concurrent requests to add the same product to the cart (change cartID and location for both requests): curl --location 'http://mag.local/graphql' --header 'Store: default' --header 'Content-Type: application/json' --data '{\"query\":\"mutation($cartId: String!, $preSku: String!, $preParentSku: String!) {\\r\\n addConfigurableProductsToCart(\\r\\n input: {\\r\\n cart_id: $cartId\\r\\n cart_items: [\\r\\n {\\r\\n parent_sku: $preParentSku\\r\\n data: {\\r\\n quantity: 1\\r\\n sku: $preSku\\r\\n }\\r\\n }\\r\\n ]\\r\\n }\\r\\n ) {\\r\\n cart {\\r\\n items {\\r\\n id\\r\\n product {\\r\\n name\\r\\n sku\\r\\n }\\r\\n quantity\\r\\n \\r\\n prices {\\r\\n price {\\r\\n value\\r\\n currency\\r\\n }\\r\\n }\\r\\n ... on ConfigurableCartItem {\\r\\n configurable_options {\\r\\n option_label\\r\\n value_label\\r\\n }\\r\\n }\\r\\n }\\r\\n total_quantity\\r\\n prices {\\r\\n grand_total {\\r\\n value\\r\\n currency\\r\\n }\\r\\n discounts {\\r\\n amount {\\r\\n value\\r\\n currency\\r\\n }\\r\\n label\\r\\n }\\r\\n subtotal_excluding_tax {\\r\\n value\\r\\n currency\\r\\n }\\r\\n } \\r\\n }\\r\\n }\\r\\n}\",\"variables\":{\"cartId\":\"VV85vRfmCrRm0aKLKkNDrXH2S5y7sSpf\",\"preParentSku\":\"Test\",\"preSku\":\"Test-A\"}}' & curl --location 'http://mag.local/graphql' --header 'Store: default' --header 'Content-Type: application/json' --data '{\"query\":\"mutation($cartId: String!, $preSku: String!, $preParentSku: String!) {\\r\\n addConfigurableProductsToCart(\\r\\n input: {\\r\\n cart_id: $cartId\\r\\n cart_items: [\\r\\n {\\r\\n parent_sku: $preParentSku\\r\\n data: {\\r\\n quantity: 1\\r\\n sku: $preSku\\r\\n }\\r\\n }\\r\\n ]\\r\\n }\\r\\n ) {\\r\\n cart {\\r\\n items {\\r\\n id\\r\\n product {\\r\\n name\\r\\n sku\\r\\n }\\r\\n quantity\\r\\n \\r\\n prices {\\r\\n price {\\r\\n value\\r\\n currency\\r\\n }\\r\\n }\\r\\n ... on ConfigurableCartItem {\\r\\n configurable_options {\\r\\n option_label\\r\\n value_label\\r\\n }\\r\\n }\\r\\n }\\r\\n total_quantity\\r\\n prices {\\r\\n grand_total {\\r\\n value\\r\\n currency\\r\\n }\\r\\n discounts {\\r\\n amount {\\r\\n value\\r\\n currency\\r\\n }\\r\\n label\\r\\n }\\r\\n subtotal_excluding_tax {\\r\\n value\\r\\n currency\\r\\n }\\r\\n } \\r\\n }\\r\\n }\\r\\n}\",\"variables\":{\"cartId\":\"VV85vRfmCrRm0aKLKkNDrXH2S5y7sSpf\",\"preParentSku\":\"Test\",\"preSku\":\"Test-A\"}}' 1. Get the cart to see the items (change cartId and location): curl --location 'http://mag.local/graphql' \\ --header 'Store: default' \\ --header 'Content-Type: application/json' \\ --data '{\"query\":\"{\\n cart(cart_id: \\\"VV85vRfmCrRm0aKLKkNDrXH2S5y7sSpf\\\") {\\n items {\\n id\\n product {\\n name\\n sku\\n }\\n quantity\\n }\\n\\n }\\n}\\n\",\"variables\":{}}'","introducedInQpt":"1.1.37","createdFor":["2.4.5-p2"],"documentedRange":"2.4.4 - 2.4.6-p2","scheduledFixRelease":"2.4.7"},"files":[{"package":"magento/magento2-base","constraint":">=2.4.4 <2.4.7","path":"patches/os/ACSD-53148_2.4.5-p2.patch","blobSha":"cb593d7750610dae8a74e1682a001ed0cc2f5071","url":"https://raw.githubusercontent.com/magento/quality-patches/11d565bdde197b9c7bac859a5698e99098b48457/patches/os/ACSD-53148_2.4.5-p2.patch","thirdParty":false,"modifies":[{"path":"vendor/magento/module-configurable-product-graph-ql/Model/Resolver/AddConfigurableProductsToCart.php","change":"modified","package":"magento/module-configurable-product-graph-ql"}],"packages":["magento/module-configurable-product-graph-ql"],"hasTests":false,"applicableVersions":{"magento-community":["2.4.6-p15","2.4.6-p14","2.4.6-p13","2.4.6-p12","2.4.6-p11","2.4.6-p10","2.4.6-p9","2.4.6-p8","2.4.6-p7","2.4.6-p6","2.4.6-p5","2.4.6-p4","2.4.6-p3","2.4.6-p2","2.4.6-p1","2.4.6","2.4.5-p17","2.4.5-p16","2.4.5-p15","2.4.5-p14","2.4.5-p13","2.4.5-p12","2.4.5-p11","2.4.5-p10","2.4.5-p9","2.4.5-p8","2.4.5-p7","2.4.5-p6","2.4.5-p5","2.4.5-p4","2.4.5-p3","2.4.5-p2","2.4.5-p1","2.4.5","2.4.4-p18","2.4.4-p17","2.4.4-p16","2.4.4-p15","2.4.4-p14","2.4.4-p13","2.4.4-p12","2.4.4-p11","2.4.4-p10","2.4.4-p9","2.4.4-p8","2.4.4-p7","2.4.4-p6","2.4.4-p5","2.4.4-p4","2.4.4-p3","2.4.4-p2","2.4.4-p1","2.4.4"],"magento-commerce":["2.4.6-p15","2.4.6-p14","2.4.6-p13","2.4.6-p12","2.4.6-p11","2.4.6-p10","2.4.6-p9","2.4.6-p8","2.4.6-p7","2.4.6-p6","2.4.6-p5","2.4.6-p4","2.4.6-p3","2.4.6-p2","2.4.6-p1","2.4.6","2.4.5-p17","2.4.5-p16","2.4.5-p15","2.4.5-p14","2.4.5-p13","2.4.5-p12","2.4.5-p11","2.4.5-p10","2.4.5-p9","2.4.5-p8","2.4.5-p7","2.4.5-p6","2.4.5-p5","2.4.5-p4","2.4.5-p3","2.4.5-p2","2.4.5-p1","2.4.5","2.4.4-p18","2.4.4-p17","2.4.4-p16","2.4.4-p15","2.4.4-p14","2.4.4-p13","2.4.4-p12","2.4.4-p11","2.4.4-p10","2.4.4-p9","2.4.4-p8","2.4.4-p7","2.4.4-p6","2.4.4-p5","2.4.4-p4","2.4.4-p3","2.4.4-p2","2.4.4-p1","2.4.4"],"mage-os":[]},"unknownVersions":[],"requires":[],"replacedWith":null,"deprecated":false}],"applicableVersions":{"magento-community":["2.4.6-p15","2.4.6-p14","2.4.6-p13","2.4.6-p12","2.4.6-p11","2.4.6-p10","2.4.6-p9","2.4.6-p8","2.4.6-p7","2.4.6-p6","2.4.6-p5","2.4.6-p4","2.4.6-p3","2.4.6-p2","2.4.6-p1","2.4.6","2.4.5-p17","2.4.5-p16","2.4.5-p15","2.4.5-p14","2.4.5-p13","2.4.5-p12","2.4.5-p11","2.4.5-p10","2.4.5-p9","2.4.5-p8","2.4.5-p7","2.4.5-p6","2.4.5-p5","2.4.5-p4","2.4.5-p3","2.4.5-p2","2.4.5-p1","2.4.5","2.4.4-p18","2.4.4-p17","2.4.4-p16","2.4.4-p15","2.4.4-p14","2.4.4-p13","2.4.4-p12","2.4.4-p11","2.4.4-p10","2.4.4-p9","2.4.4-p8","2.4.4-p7","2.4.4-p6","2.4.4-p5","2.4.4-p4","2.4.4-p3","2.4.4-p2","2.4.4-p1","2.4.4"],"magento-commerce":["2.4.6-p15","2.4.6-p14","2.4.6-p13","2.4.6-p12","2.4.6-p11","2.4.6-p10","2.4.6-p9","2.4.6-p8","2.4.6-p7","2.4.6-p6","2.4.6-p5","2.4.6-p4","2.4.6-p3","2.4.6-p2","2.4.6-p1","2.4.6","2.4.5-p17","2.4.5-p16","2.4.5-p15","2.4.5-p14","2.4.5-p13","2.4.5-p12","2.4.5-p11","2.4.5-p10","2.4.5-p9","2.4.5-p8","2.4.5-p7","2.4.5-p6","2.4.5-p5","2.4.5-p4","2.4.5-p3","2.4.5-p2","2.4.5-p1","2.4.5","2.4.4-p18","2.4.4-p17","2.4.4-p16","2.4.4-p15","2.4.4-p14","2.4.4-p13","2.4.4-p12","2.4.4-p11","2.4.4-p10","2.4.4-p9","2.4.4-p8","2.4.4-p7","2.4.4-p6","2.4.4-p5","2.4.4-p4","2.4.4-p3","2.4.4-p2","2.4.4-p1","2.4.4"],"mage-os":[]},"conditions":null,"requirements":null},"_documentation":"https://magento.watch/api","_description":"Quality patch ACSD-53148 details"}