saleor-dashboard icon indicating copy to clipboard operation
saleor-dashboard copied to clipboard

productBulkDelete mutation fails with more than 20 products

Open peelar opened this issue 2 years ago • 1 comments

Originally created by @simon-online in saleor/saleor.

What I'm trying to achieve

Delete more than 20 products

Steps to reproduce the problem

  1. Go to /dashboard/products
  2. Change "No of rows" to more than 20
  3. Select all products
  4. Try to delete them

What I expected to happen

I am able to delete the products successfully

Screenshots

https://user-images.githubusercontent.com/44495184/182540971-f7d70660-a1fb-4246-a52c-b884ed0fb465.mov

The cause

As @simon-online described, there is an issue with how the dashboard sends the product IDs:

For a small number of selected products to delete which is successful variables looks like this:

{
  variables: {
    ids: ["UHJvZHVjdDoxMTI=", "UHJvZHVjdDoxMTE="]
  }
}

But when a request for a larger number (eg. 40) of selected products to delete is made it fails and it looks like this:

{
  variables: {
    ids: [{0: "UHJvZHVjdDo3Mg==", 1: "UHJvZHVjdDo3NA==", 2: "UHJvZHVjdDoxMjI=", 3: "UHJvZHVjdDo3OQ==",…}]
  }
}

System information

Saleor version:

  • [x] v3.5.0

peelar avatar Aug 03 '22 06:08 peelar

@simon-online moved your issue here.

peelar avatar Aug 03 '22 06:08 peelar