Skip to content

fix: return the retried response when a GET request is retried - #116

Merged
colinodell merged 1 commit into
masterfrom
fix-get-url-retry
Oct 17, 2026
Merged

colinodell merged 1 commit into
masterfrom
fix-get-url-retry

Conversation

@colinodell

Copy link
Copy Markdown
Owner

When a GET request fails, often because the session expired, _get_url logs in again and retries. But it threw away the retry's result and returned the original None, so a retry that succeeded still made the public get_* method return None.

Changes

  • Return the result of the retry from _get_url.
  • Add regression tests covering a retry that succeeds and a retry that fails again.

Testing

  • The new test fails without the fix and passes with it.
  • flake8, pylint, pydocstyle and tests/test-models.py pass 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

_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>
Copilot AI balanced review requested due to automatic review settings October 17, 2026 19:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@colinodell
colinodell merged commit e02436e into master Oct 17, 2026
23 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.6.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@colinodell
colinodell deleted the fix-get-url-retry branch October 17, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants