magento2
magento2 copied to clipboard
Bulk API Product Update Unnecessarily Deletes & Re-adds Options
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”.
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.
- For more details, review the Magento Contributor Assistant documentation.
- Add a comment to assign the issue:
@magento I am working on this - To learn more about issue processing workflow, refer to the Code Contributions.
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.
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: XXXXXlabel to the ticket, indicating the functional areas it may be related to. - [ ] 4. Verify that the issue is reproducible on
2.4-developbranchDetails
- If the issue is reproducible on2.4-developbranch, please, add the labelReproduced 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: Confirmedonce verification is complete. - [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
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
- When making a request to /rest/default/async/bulk/V1/products or /rest/V1/products/options
- 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
- New options gets created even when no changes are made.
Hence Confirming the issue.
Thanks.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-14051 is successfully created for this GitHub issue.
: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.
Any update on this?