fix: getUPS() returns immediately instead of hitting dead endpoint#34
Draft
toddr-bot wants to merge 1 commit into
Draft
fix: getUPS() returns immediately instead of hitting dead endpoint#34toddr-bot wants to merge 1 commit into
toddr-bot wants to merge 1 commit into
Conversation
The qcostcgi.cgi endpoint was retired by UPS years ago. Previously, every getUPS() call would wait 30 seconds for an HTTP timeout before failing. Now it returns (undef, undef, $error) immediately with an informative message, saving callers 30 seconds of dead wait time. The deprecation warning is preserved unchanged. No behavior change for callers who already check the error return value. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9 tasks
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.
What
getUPS()now returns an error tuple immediately instead of making an HTTP request to a dead UPS endpoint.Why
The
qcostcgi.cgiendpoint was retired by UPS. Every call togetUPS()waited 30 seconds for an HTTP timeout before failing with a croak. Callers who haven't migrated away fromgetUPS()paid a 30-second penalty on every call for no reason.How
Removed the HTTP request code from
getUPS(). The function now emits its deprecation warning (unchanged) and returns(undef, undef, $error_message)immediately. This is backward-compatible — callers checking the third return value for errors see an informative message. Callers usingeval {}to catch the croak will no longer see a die, which is strictly more graceful.Net: -161 lines, +25 lines. The dead URL construction, HTTP call, and response parsing are gone.
Testing
t/getups.tto verify: deprecation warning still emitted, error tuple returned immediately, no HTTP calls mademake test)Note: PR #33 adds request validation tests for
getUPS()that test the URL construction code removed here. Those tests would need updating if this merges first.🤖 Generated with Claude Code
Quality Report
Changes: 2 files changed, 25 insertions(+), 161 deletions(-)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline