Repository navigation
fix: return the retried response when a GET request is retried - #116
Merged
Merged
Conversation
_get_url retried failed requests but discarded the retry's result, so a request that succeeded on the second attempt still returned None. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix preserves the retry limit, and regression tests cover both retry outcomes.
No open issues 🎉
What changed in this PR
Fixes GET retries so public methods receive the retry’s result instead of the original failed response.
Changes:
- Return the retried response while preserving the single-retry limit.
- Add regression tests for successful and failed retries.
| File | Description |
|---|---|
| tests/test-models.py | Tests both retry outcomes and verifies two attempts. |
| qnapstats/qnap_stats.py | Returns the result of the retried GET request. |
Review effort: Balanced
|
🎉 This PR is included in version 0.6.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
When a GET request fails, often because the session expired,
_get_urllogs in again and retries. But it threw away the retry's result and returned the originalNone, so a retry that succeeded still made the publicget_*method returnNone.Changes
_get_url.Testing
tests/test-models.pypass locally on Python 3.8 and 3.15.Merging this will create a patch release (0.6.2) because of the
fix:prefix.🤖 Generated with Claude Code