We’re finding collectionReorderProducts Jobs are either never completing or are taking hours.
To sort a collection of 1,000 products, we’d send 4 collectionReorderProducts queries of 250 moves each. Querying the Job ID of each, done stays ‘false’ for an incredibly long time or it just never completes.
Some example jobs are below, they range from a couple of moves
to up to 250.
{
"id": "gid://shopify/Job/60ffe900-1844-48ce-8d87-a82f8919adc0",
"done": false
}
{
"id": "gid://shopify/Job/5ecaf9c7-8f90-452f-9d47-2da7a00f7bb7",
"done": false
}
{
"id": "gid://shopify/Job/dc094094-f14c-4367-b3d5-2393ae24c501",
"done": true
}
{
"id": "gid://shopify/Job/24136e83-dc41-4153-a3bc-2d657ced8f71",
"done": false
}
{
"id": "gid://shopify/Job/ebdba005-2bb7-4159-8d51-71092f3f7ac4",
"done": false
}
{
"id": "gid://shopify/Job/5d862bce-bcc5-422e-8561-b9b668a9dee1",
"done": true
}
{
"id": "gid://shopify/Job/7df6f42f-22e7-46a5-a818-09d7f3c67be6",
"done": false
}
1 Like
Hey @BeefyNachos,
Looking at the jobs you’ve shared above, they appear to have all completed now. Do any of those still return false when you query them again?
When you say incredibly long? How long are you noticing this to take and is this a recent slow down you’ve noticed?
Hi @KyleG-Shopify, thanks for your reply.
Those example ones are returning True now, yes. I believe they would have taken over an hour/2 hours, but we’ve seen much longer.
We track the time to complete for all jobs and they’re usually within a few seconds. Certain stores and sometimes certain collections are as long as these example ones, quite a few hours. We’ve only recently seen this get delayed, before they were all pretty much instant.
Given this is for a collectionReorderProducts Job, merchants are questioning such a long delay.
Thanks for sharing that. Is this affecting all shops that you work with or is it consistent across specific shops?
Either way I’ll run this by our team here and see what I can dig up.
Thanks @KyleG-Shopify
It’s the minority of stores affected, the vast majority are within a few seconds.
Nothing appears consistent from a quick check, they do range from Basic to Plus plans.
Checking the last 24 hours for example, most were quick but we do have 2 for example that were over 3-4 minutes - but that might be within an expected time range though?
None from the last 24 hours were over an hour though - like the example Jobs from the first message
gid://shopify/Job/8afa9cd8-22b1-403d-a448-be0c9e214893
gid://shopify/Job/5f92583d-3499-4572-9f6b-f198f35d0390
Hey @BeefyNachos!
I dug into this with our team and found a way that you can simplify your approach. The collectionReorderProducts
mutation actually handles repositioning automatically when you move a single product, so you don’t need to specify moves for every product in the collection.
Instead of sending 4 mutations with 250 moves each, you can move any product to any position with just one move in a single mutation.
For example, to move a product to the bottom of a 1,000 product collection, you’d only need moves: [{id: "product_id", newPosition: "999"}]
and all other products will shift to accommodate the change. This eliminates the complex chunking logic that’s likely causing some of the performance bottleneck you’re experiencing.
Thanks @KyleG-Shopify, we’ll have a look at your suggestion now
1 Like
Just a quick follow up @KyleG-Shopify
We haven’t yet implemented the reduced moves API calls yet, but just wanted to flag for your records some reorder jobs which took a very long time.
gid://shopify/Job/765d0391-6d99-4090-b4dc-3cfe863da118
gid://shopify/Job/8c52229b-b88f-4a3d-bb50-d69ad036f1ca
gid://shopify/Job/c2ef07f4-3f2c-4d6d-8dee-92120a50ca98
These took 1 hour, 5 hours and 7 hours respectively. This was for an Advanced store and some newer jobs finished before these. They had quite a few jobs which took over an hour.
We’re implemented the reduced moves call now, although we’re worried we may still see this problem as some stores randomise their sort order (meaning every product requires a move record).
EDIT
Also gid://shopify/Job/62e7d2ae-5170-44c4-a434-08b18a89ce39
which took over an hour, it was the first reorder job this store made with only 92 moves.
Thanks Matthew, I’ll look in to those.
Hey @BeefyNachos,
After asking around some more, I can confirm we are actively working on improving collection jobs. As we roll out these improvements you should notice this happen less and less.
@KyleG-Shopify
Thanks for the update. We’ll keep an eye out for these improvements.
1 Like
Hey @KyleG-Shopify ,
We have been using this resource for over three years in the most efficient way. However, there has been noticeable slowness starting from August 1. We are receiving a high volume of complaints from customers.
Could you please roll back the change until a solution is found? Since the current solution is not working properly, we’ve reverted to using the old API, setting the orders one by one, which consumes significantly more resources.
Each request should complete in just a few seconds, as it did before. The regulator should follow the leaky bucket algorithm.
Thanks for the update. I’m going to take a look here to see what I can find out.