[Bug] Duplication of images in GraphQL #306
-
Ahoi! I noticed the following issue: After uploading images in backend, GraphQL returns copies of the same image (see identical
I testet on several products e.g: https://test-skipp.swell.store/admin/products/649aed7c3866e40012d1fa63 Example return from GraphQL:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Same issue here and resulting on duplicate images showing in the frontend of my store. |
Beta Was this translation helpful? Give feedback.
-
@josias-hosang cc: @Strongeyed I can confirm that it is a bug with the admin dashboard but NOT in frontend APIs (graphql/swell-js). The issue is, the client makes the PUT request with the duplicate file details of the uploaded image (for some scenario that is yet to be identified) as follows: PUT {
"$set": {
"images": [
{
"file": {
"id": "file-id-1",
"md5": "md5-1",
"url": "url-1"
},
"id": "id-1"
},
{
"file": {
"id": "file-id-2",
"md5": "md5-2",
"url": "url-2"
},
"id": "id-2"
},
{
"file": {
"id": "file-id-2",
"md5": "md5-2",
"url": "url-2"
},
"id": "id-2" // duplicate
}
]
}
} Hence, the backend also stores the same as duplicates though the image is uploaded to the server only once. But, in the admin dashboard, unique images are rendered by filtering To fix this issue for the time being, it is recommended to remove the duplicates by following the below URL: |
Beta Was this translation helpful? Give feedback.
@josias-hosang cc: @Strongeyed I can confirm that it is a bug with the admin dashboard but NOT in frontend APIs (graphql/swell-js).
The issue is, the client makes the PUT request with the duplicate file details of the uploaded image (for some scenario that is yet to be identified) as follows:
PUT
/products/product_id