Steps to reproduce
- Have an app to create a app-shared-source with a product
p-A. - Create a collection
c-Aand attach the shared source. - Create a collection
c-Band attach the shared source. - With the app, use the mutation
collectionAddProductsV2to one or more productsp-Bto collectionc-A. - Create a third collection
c-Cand attach the shared source
Expected result
c-Ahas the shared source (withp-A) + another non-shared source with withp-Bc-Bhas the shared source. Only product isp-Ac-Chas the shared source. Only product isp-A
Actual result
c-Ahas the shared source withp-Aandp-Bc-Bhas the shared source withp-Ac-Chas the shared source withp-Aandp-B
Bug 1
Adding a product to a collection actually updated the source and effectively affects all collections using the source. This is materialized with c-C now having p-B despite the app requested it to be added only to collection c-A.
Bug 2
At this point the shared source is affected by bug 1 and has two products instead of one. However c-B is only showing a single product (see screenshot below). I suspect it to be some kind of caching issue.
Additional resources
Both screenshot below have been captured after reloading the browser at least 5 minutes after the steps to reproduce have been applied
c-A screenshot
c-B screenshot
the source data queried from the graphql api
Please note that it has two additional products added by the mutation
{
"id": "gid://shopify/CollectionConditionsSource/25498058983",
"title": "test shared source multi collection",
"targetType": "PRODUCTS",
"products": {
"nodes": [
{
"id": "gid://shopify/Product/8868004724967",
"title": "The Videographer Snowboard"
},
{
"id": "gid://shopify/Product/8868004757735",
"title": "The Archived Snowboard"
},
{
"id": "gid://shopify/Product/9519119433959",
"title": "test product"
}
],
}
},
c-B products from the graphql API
Please note that it has only one product despite using a source with three products:
"collection": {
"title": "c-B",
"products": {
"edges": [
{
"node": {
"title": "The Videographer Snowboard"
},
"cursor": "eyJsYXN0X2lkIjo4ODY4MDA0NzI0OTY3LCJsYXN0X3ZhbHVlIjoiMCJ9"
}
],
"pageInfo": {
"hasNextPage": false
}
}
}
},
Why is it critical?
Adding products to a collection will add to the source instead which will spread to all collections using that source. It breaks the contract of adding to just one collection, and it break the announced backward compatibility of the mutation collectionAddProductsV2 which can now transitively add products to many collection at once.
As for bug 2 - it’s quite obvious. It’s not showing the right set of products.

