Cart function errors are misleading to merchants

We see this error come up often for stores who get regularly hit by bots:
InstructionCountLimitExceededError

This is ALARMING to merchants, they submit the error reports, and take time to open a support request with our team.

Our team looks into every error reported by our merchants, so this also takes time out of our day to dig into these function runs.

Every single time we look into this, it’s the same pattern, a bot has added thousands of products, and the quantity is absurdly high (800k+) for each item in the cart.

This has nothing to do with our function run, or capacity or fuel, and causes a bunch of headaches for everyone involved.

Can we please mitigate these immediately? Cart functions should be improving the ecosystem, but this is definitely an area for improvement.

I would ask the team… why do merchants need to see function run errors, why not allow us as partners to input bug reporting credentials so it can be reported directly to our systems the way everything else is.

Hi @releod, InstructionCountLimitExceeded errors are real errors that are occuring (you’re exceeding the fuel limits for the given inputs.) While the inputs themselves may be from bots it’s also a signal that your function doesn’t scale to support large cart inputs which some merchants will experience from time to time depending on their business.

There are some things we’re doing at the platform level to try to mitigate the impact of the behavior, but there are some things you can do as well if you want to avoid these.

If you’re using JavaScript you can look at migrating your function logic to Rust, which from my experience would eliminate the errors your function is seeing.

The other option is to ensure you’re on the latest version of our JavaScript toolchain using @shopify/shopify_function 1.0.3, and also testing for the fuel usage of your Function at 200 line items which is the point where our limits will start scaling with the cart size input.

3 Likes

Hi David

Ah yes, will try migrating this over to RUST soon and see if that helps.

We don’t see the error in regular customer behaviour, it only appears when the bots have overflowed the cart with 800k+ quantities on uncountable number of line-items.

This is what led us to believe it only occurs in bot activity.

Hi David

Confirmed your reply is the solution, opted to migrate functions to RUST.

Happy to report the error rate dropped off entirely. :+1:

3 Likes

Great to see this!! Thanks for coming back to confirm this fixed the error rate :slight_smile:

1 Like