ACSD-52613: Cache and indexes are refreshed even with no updates

The ACSD-52613 patch fixes the issue where the Adobe Commerce issue where the cache and indexes are refreshed when no updates are made to Inventory_source items by REST API. This patch is available when the Quality Patches Tool (QPT) 1.1.37 is installed. The patch ID is ACSD-52613. Please note that the issue was fixed in Adobe Commerce 2.4.7.

Affected products and versions

The patch is created for Adobe Commerce version:

  • Adobe Commerce (all deployment methods) 2.4.6

Compatible with Adobe Commerce versions:

  • Adobe Commerce (all deployment methods) 2.4.6 - 2.4.7
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your Adobe 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

Cache and indexes are refreshed when no updates are made to Inventory_source items by REST API.

Prerequisites:

Inventory modules installed

Steps to reproduce:

  1. Turn developer mode to have debug.log.

  2. Prepare import file with 100 products - import.csv:

    code language-none
    sku    name    product_type    attribute_set_code    price
    test_sku_1    test_sku_1    simple    Default    10
    test_sku_2    test_sku_2    simple    Default    10
    ...
    test_sku_100    test_sku_100    simple    Default    10
    
  3. Import products from import.csv

  4. Create new stock and source called test_stock and test_source.

  5. Assign new stock to the website, and assign source to stock.

  6. Create a new integration with access to all, activate it and copy-paste the Access Token.

  7. Go to Stores > Configuration > Services > Oauth > Consumer Settings and enable Allow OAuth Access Tokens to be used as standalone Bearer tokens.

  8. Flush the cache.

  9. Set indexers as Updated by schedule

  10. Execute API request

    POST ../rest/V1/inventory/source-items

    using this as the body

    code language-none
    {
     "sourceItems": [
         {
             "sku": "test_sku_1",
             "source_code": "test_source",
             "quantity": 24,
             "status": 1
         },
         {
             "sku": "test_sku_2",
             "source_code": "test_source",
             "quantity": 50,
             "status": 1
         },
         {
             "sku": "test_sku_3",
             "source_code": "test_source",
             "quantity": 50,
             "status": 1
         },
         {
             "sku": "test_sku_4",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_5",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_6",
             "source_code": "test_source",
             "quantity": 19,
             "status": 1
         },
         {
             "sku": "test_sku_7",
             "source_code": "test_source",
             "quantity": 50,
             "status": 1
         },
         {
             "sku": "test_sku_8",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_9",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_10",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_11",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_12",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_13",
             "source_code": "test_source",
             "quantity": 50,
             "status": 1
         },
         {
             "sku": "test_sku_14",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_15",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_16",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_17",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_18",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_19",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_20",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_21",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_22",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_23",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_24",
             "source_code": "test_source",
             "quantity": 2,
             "status": 1
         },
         {
             "sku": "test_sku_25",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_26",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_27",
             "source_code": "test_source",
             "quantity": 13,
             "status": 1
         },
         {
             "sku": "test_sku_28",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_29",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_30",
             "source_code": "test_source",
             "quantity": 1,
             "status": 1
         },
         {
             "sku": "test_sku_31",
             "source_code": "test_source",
             "quantity": 2,
             "status": 1
         },
         {
             "sku": "test_sku_32",
             "source_code": "test_source",
             "quantity": 1,
             "status": 1
         },
         {
             "sku": "test_sku_33",
             "source_code": "test_source",
             "quantity": 49,
             "status": 1
         },
         {
             "sku": "test_sku_34",
             "source_code": "test_source",
             "quantity": 12,
             "status": 1
         },
         {
             "sku": "test_sku_35",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_36",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_37",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_38",
             "source_code": "test_source",
             "quantity": 10,
             "status": 1
         },
         {
             "sku": "test_sku_39",
             "source_code": "test_source",
             "quantity": 4,
             "status": 1
         },
         {
             "sku": "test_sku_40",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_41",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_42",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_43",
             "source_code": "test_source",
             "quantity": 2,
             "status": 1
         },
         {
             "sku": "test_sku_44",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_45",
             "source_code": "test_source",
             "quantity": 4,
             "status": 1
         },
         {
             "sku": "test_sku_46",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_47",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_48",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_49",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_50",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_51",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_52",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_53",
             "source_code": "test_source",
             "quantity": 2,
             "status": 1
         },
         {
             "sku": "test_sku_54",
             "source_code": "test_source",
             "quantity": 1,
             "status": 1
         },
         {
             "sku": "test_sku_55",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_56",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_57",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_58",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_59",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_60",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_61",
             "source_code": "test_source",
             "quantity": 16,
             "status": 1
         },
         {
             "sku": "test_sku_62",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_63",
             "source_code": "test_source",
             "quantity": 2,
             "status": 1
         },
         {
             "sku": "test_sku_64",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_65",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_66",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_67",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_68",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_69",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_70",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_71",
             "source_code": "test_source",
             "quantity": 16,
             "status": 1
         },
         {
             "sku": "test_sku_72",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_73",
             "source_code": "test_source",
             "quantity": 3,
             "status": 1
         },
         {
             "sku": "test_sku_74",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_75",
             "source_code": "test_source",
             "quantity": 4,
             "status": 1
         },
         {
             "sku": "test_sku_76",
             "source_code": "test_source",
             "quantity": 50,
             "status": 1
         },
         {
             "sku": "test_sku_77",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_78",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_79",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_80",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_81",
             "source_code": "test_source",
             "quantity": 2,
             "status": 1
         },
         {
             "sku": "test_sku_82",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_83",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_84",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_85",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_86",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_87",
             "source_code": "test_source",
             "quantity": 4,
             "status": 1
         },
         {
             "sku": "test_sku_88",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_89",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_90",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_91",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_92",
             "source_code": "test_source",
             "quantity": 4,
             "status": 1
         },
         {
             "sku": "test_sku_93",
             "source_code": "test_source",
             "quantity": 4,
             "status": 1
         },
         {
             "sku": "test_sku_94",
             "source_code": "test_source",
             "quantity": 3,
             "status": 1
         },
         {
             "sku": "test_sku_95",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_96",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_97",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_98",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_99",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         },
         {
             "sku": "test_sku_100",
             "source_code": "test_source",
             "quantity": 0,
             "status": 0
         }
     ]
    }
    
  11. Remove all the logs from var/log

  12. Run the REST API request again.

  13. Check the var/log/debug.log.

Expected results:

Cache should not be cleaned and the indexes should not be executed after the second run since nothing was changed.

Actual results:

The var/log/debug.log contains the entry related to the cache clear.

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:

For info about other patches available in QPT, refer to Quality Patches Tool: Search for patches in the Quality Patches Tool guide.

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