Skip to content

fix: retry transient connection failures for API queries - #32

Merged
bps merged 1 commit into
mainfrom
fix/api-connectivity-retries
Sep 22, 2026
Merged

bps merged 1 commit into
mainfrom
fix/api-connectivity-retries

Conversation

@bps

@bps bps commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Summary

The scheduled integration run failed when its first get_me request timed out connecting to Hardcover; the other 22 tests passed. Retry transient network failures in the API client so both the plugin and live tests can recover from this kind of blip.

  • Retry recognizable read-only GraphQL queries after transient connection or response-read failures, including timeouts, connection resets, incomplete reads, and temporary DNS failures.
  • Allow at most three total attempts, shared with the existing HTTP 429 retries, with 1- and 2-second backoff for network failures.
  • Never replay mutations after network failures. Preserve the existing rate-limit retry behavior for mutations.
  • Fail immediately for certificate errors, permanent DNS failures, authentication errors, and other non-retryable errors. Preserve the final network exception when retries are exhausted.
  • Add regression coverage for recovery, exhaustion, mutation safety, response cleanup, request preservation, and the shared retry limit.

This PR contains only the API retry change and its tests. GitHub Actions runtime/cache upgrades are intentionally excluded.

Validation

  • uv run pytest --tb=short -q -rs --cov-fail-under=90: 518 passed, including all 23 live API tests; 94.85% coverage.
  • uv run ruff check src/ test/: passed.
  • uv run ruff format --check src/ test/ --exclude src/hardcover_sync/_version.py: passed.
  • uv run pyright src/hardcover_sync/api.py: passed.
  • git diff --check origin/main...HEAD: passed.

The full-project local type check has six pre-existing errors outside the changed files; the same errors were reproduced on the unchanged baseline.

@bps
bps marked this pull request as ready for review September 22, 2026 16:16
@bps
bps merged commit facb1b7 into main Sep 22, 2026
4 checks passed
@bps bps mentioned this pull request Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant