Could you please consider adding some sort of header to tell us what the timeout is for each request? ie `X-shopify-timeout: 10s` otherwise we have no way to gauge how much time we can spend quoting and thus how accurate it can be. ie do we have time to bin pack? Do we have time to get a real quote from a carrier? Or must we use a fallback formula based quote?
Having a dynamic timeout is great and all especially if it leaves the upper end for most sites high but it's pretty useless and will result in tons of errors if we can't say hey the timeout is X seconds for this request and we already spent 80% of X, revert to the fallback rates instead because carriers, bin packing, etc are too slow for this request.
@epelc great idea! This would help apps make logical decisions on what components we can keep enabled and what would need to be skipped to save time.
There's the added benefit from a support perspective where we can identify rates that have actually timed out based on the tiered timeout since we would know the actual timeout limit of each request.
We have heard similar feedback from others and are looking into what would be possible to implement and in what kind of timeframe. We will definitely get back to the community as soon as we have any news to share in this regard.
I think this is a much more reasonable initiative, some questions/comments though:
- before anything is rolled out, will/can comms be rolled out to merchants advising them of such a change?
- is the RPM calculated as a rolling window or an average? if so over how long?
- is this going to be applied to Shopify provided plugins too such as the in-build fedex connectors?
Unfortunately we have already started rolling this out, but feel free to reach out to your merchants directly if you feel they need to take any actions with regard to this change.
The RPM is calculated on a rolling 30s window.
I believe plugins should not be affected.
I have some great news to share. Our team has added a new field to the header that includes the response timeout for a given request, named X-Shopify-Timeout. The value given is in milliseconds. Hopefully this will help with your implementations!
As always, please let us know if you have any further feedback. Thanks!
I have a question on how the RPM is calculated.
1. Does this only applies when shipping_rates.json is called or it it when prepare_shipping_rates.json and async_shipping_rates.json are called together?
2. What if we only use prepare_shipping_rates.json without the async_shipping_rates.json?
Thank you in advance.