Document the v4 error-shape change and UPS's UTC timezone fallback - #178
Merged
Conversation
Two gaps found reading main over before publishing 4.0.0. The CHANGELOG never said that carriers/dhl.js and carriers/fedEx.js moved to native fetch and now reject with @stores.com/http-error. That is the most disruptive change in the release and the easiest to hit silently: FedEx used to reject with http-errors, which put the status on err.status/err.statusCode, and DHL used to reject with a plain Error whose message was "<status> <method> <url> <body>". Now both carry err.name === 'HttpError', a "<status> <statusText>" message that the response body's errors[] text replaces when it has any, and the status only at err.cause.status — which is what test/carriers/dhl.js asserts today. Also records that `request` is gone (it was required by those two files but never declared, resolving transitively through node-geocoder) along with `http-errors` and the unused `xml2js`. The README said an offsetless timestamp falls back to the local machine's timezone, which stopped being true for UPS when Mail Innovations timestamps started reading `defaultTimezone`: UPS falls back to UTC. The `defaultTimezone` option also still listed DHL and USPS only, omitting Pitney Bowes and now UPS. Docs only — no code changes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Coverage Report for CI Build 30510346662Coverage remained the same at 86.736%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found reading
mainover before publishing 4.0.0. Docs only — no code changes.1. The CHANGELOG doesn't mention the error-shape change
carriers/dhl.jsandcarriers/fedEx.jsmoved to nativefetchand now reject with@stores.com/http-error. That is the most disruptive change in the release and the CHANGELOG's 4.0.0 section never says so — the onlyhttp-errormention is about thedhl-ecommerce-solutionsdependency bump.What actually changed for a consumer:
http-errors, status onerr.status/err.statusCodeHttpError, status onerr.cause.statusError, message"<status> <method> <url> <body>"HttpError, message"<status> <statusText>"— replaced by the body'serrors[]text when it has anyThis is verified against our own code, not inferred:
test/carriers/dhl.js:133-137onmainassertserr.cause.status === 401and its comment records why it can no longer assert on the message.@stores.com/http-error@1.2.0setscauseto theResponseand overwritesmessagefromerr.json.errors[], so neither the type, the message text, norerr.statussurvives the upgrade.Anyone doing
if (err.status === 404)or matching error text gets silence instead of a match. That belongs in the CHANGELOG before it publishes, not after someone finds it.Also recorded under Removed:
requestis gone. It was required by those two files but never declared as a dependency — it resolved transitively throughnode-geocoder, so removing geocoding without the fetch migration would have broken the package at require time on a fresh install.http-errors(replaced by@stores.com/http-error) andxml2js(which nothing required even at 3.5.3).2. The README's timezone fallback is wrong for UPS
The README says an offsetless timestamp falls back to the local machine's timezone. That stopped being true for UPS in #172, where Mail Innovations timestamps started reading
defaultTimezoneand deliberately fall back to UTC instead — so a Mail Innovations scan is never interpreted in the timezone of whichever machine happens to be running. Fixed in both places the sentence appears.The
defaultTimezoneoption section also listed DHL and USPS only. Pitney Bowes has used it since before this release (carriers/pitneyBowes.js:83) and UPS uses it now, so both are added.Verification
git diff --name-onlyisCHANGELOG.mdandREADME.md. No code touched.mainat30dddf6withnpm packand installed the tarball into an empty project: 15 packages,require('@stores.com/bloodhound')resolves, andguessCarrier()returns UPS/USPS/OnTrac correctly. No undeclared dependency remains after therequestremoval.latestis still3.5.3and there is nov4.0.0tag, so nothing here is retroactive.🤖 Generated with Claude Code