Slow rate requests can prevent shipping calculation from completing

Created on 2 September 2022, over 2 years ago
Updated 26 April 2024, 8 months ago

Problem/Motivation

When for whatever reason getting shipping rates from a USPS takes longer than the host HTTP server timeout the shipping selection breaks and checkout cannot proceed. This happens both when loading the order information page when an address has already been entered before, and when requesting rates via ajax when a complete address is entered or the recalculate button is clicked.

I experienced this due to the USPS API taking longer than 60 seconds to return rates due to infrastructure problems.

The USPS PHP API library this module depends upon sets a default timeout of 60 seconds which is way too long in the context we're using it.

Proposed resolution

Add a shorter timeout for rate requests. This requires changes to the USPS PHP API dependency which is abandoned so I am also including a patch for it while we work on finding a replacement (vinceg/usps-php-api).

πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rhovland Oregon

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024