magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Bulk API Product Update Unnecessarily Deletes & Re-adds Options

Open gusdemayo opened this issue 9 months ago • 6 comments

Preconditions and environment

Magento 2.4

Steps to reproduce

When making a request to /rest/default/async/bulk/V1/products such as

[
	{
		"product": {
              	"sku": "12345",
                "price": 20.00,
                "options": [
                    {
                      	"product_sku": "12345",
                        "title": "UOM",
                        "type": "radio",
                        "is_require": false,
                        "values": [
                            {
                                "title": "Pack of 10",
                                "sort_order": 1,
                                "price": 0,
                                "price_type": "fixed",
                                "sku": "PK"
                            },
                            {
                          	"title": "Case of 100",
                                "sort_order": 2,
                                "price": 10.00,
                                "price_type": "fixed",
                                "sku": "CS"
                            }
                        ]
                }
    	    ]
  	}
    }
]

If I make the exact same request twice, changing nothing about the product options, it will completely remove the existing catalog_product_option table entry(ies) and re-create them, rather than only updating the changed data, and resorting to completely re-creating the options only when strictly necessary

Expected result

If I make a request to update a set of product options, it should preserve the options as much as possible & avoid affecting cart items with selected options

Actual result

It completely replaces existing options, even when no changes are made

Additional information

No response

Release note

No response

Triage and priority

  • [ ] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • [x] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • [ ] Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • [ ] Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • [ ] Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

gusdemayo avatar Feb 21 '25 20:02 gusdemayo

Hi @gusdemayo. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.


Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

m2-assistant[bot] avatar Feb 21 '25 20:02 m2-assistant[bot]

Hi @engcom-Delta. 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: :point_down:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • [ ] 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • [ ] 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.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. Add label Issue: Confirmed once verification is complete.
  • [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.

m2-assistant[bot] avatar Feb 24 '25 02:02 m2-assistant[bot]

Hi @gusdemayo ,

Thanks for your reporting and collaboration. We have verified the issue in latest 2.4-develop instance and the issue is reproducible. Kindly refer the screenshots.

Steps to reproduce

  1. When making a request to /rest/default/async/bulk/V1/products or /rest/V1/products/options

Image

Image

  1. If we make the exact same request twice, changing nothing about the product options, it will completely remove the existing catalog_product_option table entry(ies) and re-create them, rather than only updating the changed data, and resorting to completely re-creating the options only when strictly necessary
  2. New options gets created even when no changes are made.

Image Hence Confirming the issue. Thanks.

engcom-Delta avatar Feb 26 '25 11:02 engcom-Delta

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-14051 is successfully created for this GitHub issue.

github-jira-sync-bot avatar Feb 26 '25 11:02 github-jira-sync-bot

:white_check_mark: Confirmed by @engcom-Delta. Thank you for verifying the issue.
Issue Available: @engcom-Delta, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

m2-assistant[bot] avatar Feb 26 '25 11:02 m2-assistant[bot]

Any update on this?

gusdemayo avatar Jun 19 '25 17:06 gusdemayo