ACP2E-5077: Concurrent customerCart GraphQL queries or POST /V1/carts/mine REST requests create duplicate active carts
The ACP2E-5077 patch fixes the issue where concurrent customerCart GraphQL queries or POST /V1/carts/mine REST requests create duplicate active carts for accounts that do not already have an active cart. This patch is available when the Quality Patches Tool (QPT) 1.1.85 is installed. The patch ID is ACP2E-5077. Please note that this issue is scheduled to be fixed in Adobe Commerce 2.4.10.
Affected products and versions
The patch is created for Adobe Commerce version:
- Adobe Commerce (all deployment methods) 2.4.7-p10, 2.4.8-p5
Compatible with Adobe Commerce versions:
- Adobe Commerce (all deployment methods) 2.4.7-p7 - 2.4.9
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
Concurrent customerCart GraphQL queries or POST /V1/carts/mine REST requests create duplicate active carts for accounts that do not already have an active cart.
Steps to reproduce:
-
Make sure that the account has no active cart:
code language-sql UPDATE quote SET is_active = 0 WHERE customer_id = <customer_id> AND is_active = 1; -
Generate a token:
code language-graphql mutation { generateCustomerToken(email: "<email>", password: "<password>") { token } } -
Send two
customerCartGraphQL queries at the same time with the same token, for example:code language-bash for i in 1 2; do curl -s '<base-url>/graphql' -H 'Content-Type: application/json' -H 'Authorization: Bearer <token>' \ --data '{"query":"{ customerCart { id email } }"}' & done; wait -
Check the active carts:
code language-sql SELECT customer_id, COUNT(*) AS cnt, GROUP_CONCAT(entity_id ORDER BY entity_id) AS quote_ids FROM quote WHERE is_active = 1 AND customer_id = <customer_id> GROUP BY customer_id; -
Repeat steps one to four with two concurrent
POST /V1/carts/mineREST requests that use the same token.
Expected results:
- Both requests return the same cart ID.
- The account has one active cart.
Actual results:
- The requests return different cart IDs.
- The account has two active carts.
Apply the patch
To apply individual patches, use the following links depending on your deployment method:
- Adobe Commerce or Magento Open Source on-premises: Quality Patches Tool > Usage in the Quality Patches Tool guide
- Adobe Commerce on cloud infrastructure: Upgrades and Patches > Apply Patches in the Commerce on Cloud Infrastructure guide
Related reading
To learn more about Quality Patches Tool, refer to:
- Quality Patches Tool: A self-service tool for quality patches in the Tools guide