Skip to content

2.2.6 CE Updating product quantity via REST API does not clean product cache #18999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AndrewPenry opened this issue Nov 1, 2018 · 16 comments
Closed
Labels
Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@AndrewPenry
Copy link

Preconditions

  1. Magneto 2.2.6 with Sample Data in production mode
  2. PHP 7.0

Steps to reproduce

  1. View the product page for Chaz Kangeroo Hoodie (/chaz-kangeroo-hoodie.html)

  2. Update the stock for Chaz Kangeroo Hoodie-XS-Orange via the REST API, setting it to 0:

    PUT http://example.com/rest/V1/products/MH01-XS-Orange/stockItems/54

{
  "stockItem":
  {
    "item_id": 54,
    "product_id": 54,
    "stock_id": 1,
    "qty": 0,
    "is_in_stock": false,
    "is_qty_decimal": false,
    "show_default_notification_message": false,
    "use_config_min_qty": true,
    "min_qty": 0,
    "use_config_min_sale_qty": 1,
    "min_sale_qty": 1,
    "use_config_max_sale_qty": true,
    "max_sale_qty": 10000,
    "use_config_backorders": true,
    "backorders": 0,
    "use_config_notify_stock_qty": true,
    "notify_stock_qty": 1,
    "use_config_qty_increments": true,
    "qty_increments": 0,
    "use_config_enable_qty_inc": true,
    "enable_qty_increments": false,
    "use_config_manage_stock": true,
    "manage_stock": true,
    "low_stock_date": null,
    "is_decimal_divided": false,
    "stock_status_changed_auto": 1
  }
}
  1. Refresh the product page for Chaz Kangeroo Hoodie (/chaz-kangeroo-hoodie.html)

Expected result

  1. The swatch for the out-of-stock simple product (Chaz Kangeroo Hoodie-XS-Orange) should immediately be non-selectable.

Actual result

  1. The swatch remains selectable until the cache is manually flushed.

It does not appear that changing the inventory from 0 to !=0 via the WebAPI clears the cache like it does when you save the product from the admin. A similar issue also occurs when the quantity of the last child of a configurable product is set to 0 via REST API. Both the child and parent change to out-of-stock, but the configurable product remains on catalog listing pages until the cache is manually flushed.

@magento-engcom-team
Copy link
Contributor

Hi @AndrewPenry. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me $VERSION instance

where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop).
For more details, please, review the Magento Contributor Assistant documentation.

@AndrewPenry do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Nov 1, 2018
@AndrewPenry
Copy link
Author

@magento-engcom-team give me 2.2.6 instance

@magento-engcom-team
Copy link
Contributor

Hi @AndrewPenry. Thank you for your request. I'm working on Magento 2.2.6 instance for you

@magento-engcom-team
Copy link
Contributor

Hi @AndrewPenry, here is your Magento instance.
Admin access: http://ec2-34-228-235-121.compute-1.amazonaws.com/i-18999-2-2-6//admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@AndrewPenry
Copy link
Author

@AndrewPenry do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

It's easier to start with the sample data, but I don't think the Assisant will let me. So here are instructions starting from vanilla without sample data:

Steps to reproduce from vanilla

  1. Create a new product (TEST) with 2 configurations (RED and BLUE). Give both of these simple products a positivew quantity.

  2. View the product page for the new product.

  3. Update the stock for one of the simple products via the REST API, setting it to 0:

    PUT /rest/V1/products/TEST-RED/stockItems/1

{
  "stockItem":
  {
    "item_id": 1,
    "product_id": 1,
    "stock_id": 1,
    "qty": 0,
    "is_in_stock": false,
    "is_qty_decimal": false,
    "show_default_notification_message": false,
    "use_config_min_qty": true,
    "min_qty": 0,
    "use_config_min_sale_qty": 1,
    "min_sale_qty": 1,
    "use_config_max_sale_qty": true,
    "max_sale_qty": 10000,
    "use_config_backorders": true,
    "backorders": 0,
    "use_config_notify_stock_qty": true,
    "notify_stock_qty": 1,
    "use_config_qty_increments": true,
    "qty_increments": 0,
    "use_config_enable_qty_inc": true,
    "enable_qty_increments": false,
    "use_config_manage_stock": true,
    "manage_stock": true,
    "low_stock_date": null,
    "is_decimal_divided": false,
    "stock_status_changed_auto": 1
  }
}
  1. Refresh the product page.

Expected result

  1. The option for the out-of-stock simple product (TEST-RED) should immediately be non-selectable.

Actual result

  1. The option remains selectable until the cache is manually flushed.

@AndrewPenry
Copy link
Author

@magento-engcom-team give me 2.2.6 instance

@magento-engcom-team
Copy link
Contributor

Hi @AndrewPenry. Thank you for your request. I'm working on Magento 2.2.6 instance for you

@magento-engcom-team
Copy link
Contributor

Hi @AndrewPenry, here is your Magento instance.
Admin access: http://ec2-34-228-235-121.compute-1.amazonaws.com/i-18999-2-2-6//admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@AndrewPenry
Copy link
Author

@magento-engcom-team give me 2.2.6 instance

@magento-engcom-team
Copy link
Contributor

Hi @AndrewPenry. Thank you for your request. I'm working on Magento 2.2.6 instance for you

@magento-engcom-team
Copy link
Contributor

Hi @AndrewPenry, here is your Magento instance.
Admin access: http://ec2-34-228-235-121.compute-1.amazonaws.com/i-18999-2-2-6//admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@AndrewPenry
Copy link
Author

@magento-engcom-team give me 2.2.5 instance

@magento-engcom-team
Copy link
Contributor

Hi @AndrewPenry. Thank you for your request. I'm working on Magento 2.2.5 instance for you

@magento-engcom-team
Copy link
Contributor

Hi @AndrewPenry, here is your Magento instance.
Admin access: http://34.228.235.121/i-18999-2-2-5//admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Nov 6, 2018

Hi @engcom-backlog-nazar. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 6. Add label Issue: Confirmed once verification is complete.

  • 7. Make sure that automatic system confirms that report has been added to the backlog.

@ghost ghost added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Nov 6, 2018
@ghost
Copy link

ghost commented Nov 6, 2018

Hi @AndrewPenry thank you for you report, i'm closing this as duplicate to this -> #19043, the same logic affected,

@ghost ghost closed this as completed Nov 6, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests

2 participants