Closed dpatil-magento closed 2 years ago
Hi @dpatil-magento. Thank you for your report. To help us process this issue please make sure that you provided the following information:
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 give me 2.4-develop instance
- upcoming 2.4.x release
For more details, please, review the Magento Contributor Assistant documentation.
Please, add a comment to assign the issue: @magento I am working on this
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, please join the Community Contributions Triage session to discuss the appropriate ticket.
:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
Hi @pronto2000. 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:
Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.Issue: Clear Description
label to the issue by yourself.Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.I can confirm the issue description and I can add some additional insights here. I created two stores: default (1) and second (2), running the GraphQL query similar to the one above ran the query below:
SELECT `cat_index`.`category_id` FROM `catalog_category_product_index_store1` AS `cat_index`
INNER JOIN `store` ON store.store_id = 1
INNER JOIN `store_group` ON store.group_id = store_group.group_id AND cat_index.category_id != store_group.root_category_id WHERE (product_id = 1200)
above is generated in app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductCategories.php
Please note that I created 2 websites, each having it's one store and each store has it's own root category and store_view. For the product (id = 1200) I assigned categories from both websites to it and as a separate option I enabled the first website only.
The query above correctly assumes assumes that default store it 1 and tries to get the information from index_store1 using store_id 1. The result however is wrong because this table contains information from both stores (category 17 is from website 1 and category 34 is from website 2):
+-------------+
| category_id |
+-------------+
| 17 |
| 34 |
+-------------+
Inspecting tabel catalog_category_product_index_store1
reveals that this table contains ALL category / product association and ALL rows have store_id = 1. catalog_category_product_index_store2
exists as well, but it is empty.
here's a sample from catalog_category_product_index_store1
select * from catalog_category_product_index_store1 where product_id = 1200;
+-------------+------------+----------+-----------+----------+------------+
| category_id | product_id | position | is_parent | store_id | visibility |
+-------------+------------+----------+-----------+----------+------------+
| 17 | 1200 | 9999 | 0 | 1 | 4 |
| 34 | 1200 | -1 | 1 | 1 | 4 |
+-------------+------------+----------+-----------+----------+------------+
while
select count(*) from catalog_category_product_index_store2;
+----------+
| count(*) |
+----------+
| 0 |
+----------+
It looks like the data stored in those index tables is fundamentally wrong and this is not a problem with GraphQL, but with indexing itself.
Please note that while it's technically possible to filter out correct rows it's going to be a quick and dirty workaround ignoring the core problem which remains there potentially causing additional problem.
@magento I'm working on this
What's the state of this issue? Seems like there is a PR ready to be merged, but nothing happened since January...
Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Reproduced on 2.4.x
, ^Area:.*
Once all required labels are present, please add Issue: Confirmed
label again.
:white_check_mark: Jira issue https://jira.corp.magento.com/browse/AC-2515 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @cpartica. Thank you for verifying the issue.
Issue Available: @cpartica, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
Based on priority I am working on this issue's PR and fixing the PR comments and automation tests
Hello @dpatil-magento
As I can see this issue got fixed in the scope of the internal Jira ticket AC-2515
by the internal team
Related commits: https://github.com/magento/magento2/search?q=AC-2515&type=commits
Based on Jira, target version is 2.4.5
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.