fix: retry AAB upload on RedirectMissingLocation (#186) #196

Closed
guettlibot wants to merge 0 commits from issue-186-fix into main
guettlibot commented 2026-05-24 02:59:27 +00:00 (Migrated from codeberg.org)

Summary

  • Wrap the resumable AAB bundle upload in a retry loop with exponential backoff (up to 3 attempts, delays 10 s / 20 s) to survive transient httplib2.error.RedirectMissingLocation errors.
  • Recreate MediaFileUpload on each attempt, since resumable uploads cannot reuse the same object after a failure.
  • Raise RuntimeError (chained to the last exception) when all attempts are exhausted.

Tests

  • test_retries_once_on_redirect_error_then_succeeds — retries after one redirect error and succeeds
  • test_raises_after_all_attempts_exhausted — raises RuntimeError after 3 failures
  • test_backoff_delays_are_10s_then_20s — verifies time.sleep(10) then time.sleep(20)
  • test_fresh_media_upload_created_on_each_attemptMediaFileUpload constructed twice on one retry
  • test_succeeds_on_first_attempt — happy path unaffected

Depends on #185 (httplib2 infrastructure — included in this PR until #185 is merged).

🤖 Generated with Claude Code

## Summary - Wrap the resumable AAB bundle upload in a retry loop with exponential backoff (up to 3 attempts, delays 10 s / 20 s) to survive transient `httplib2.error.RedirectMissingLocation` errors. - Recreate `MediaFileUpload` on each attempt, since resumable uploads cannot reuse the same object after a failure. - Raise `RuntimeError` (chained to the last exception) when all attempts are exhausted. ## Tests - `test_retries_once_on_redirect_error_then_succeeds` — retries after one redirect error and succeeds - `test_raises_after_all_attempts_exhausted` — raises `RuntimeError` after 3 failures - `test_backoff_delays_are_10s_then_20s` — verifies `time.sleep(10)` then `time.sleep(20)` - `test_fresh_media_upload_created_on_each_attempt` — `MediaFileUpload` constructed twice on one retry - `test_succeeds_on_first_attempt` — happy path unaffected Depends on #185 (httplib2 infrastructure — included in this PR until #185 is merged). 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.