Skip to content

fix Play Store upload: replace resumable upload with single-request upload#2147

Merged
transphorm merged 6 commits into
devfrom
fix/play-store-upload-resumable
Jun 10, 2026
Merged

fix Play Store upload: replace resumable upload with single-request upload#2147
transphorm merged 6 commits into
devfrom
fix/play-store-upload-resumable

Conversation

@transphorm

@transphorm transphorm commented Jun 2, 2026

Copy link
Copy Markdown
Member

Summary

Android store deploys fail at the Play Store upload step with:

❌ Play Store upload failed after 3 attempts: Redirected but the response is missing a Location: header.

This is httplib2's RedirectMissingLocation: the resumable-upload protocol signals "resume incomplete" with 308 responses that intentionally carry no Location header, and httplib2 treats them as broken redirects. #2145 tried to fix this by pinning httplib2 — but the 2026-06-02 deploy run had the pin (its "Verify httplib2 version" step printed httplib2 0.31.2) and still failed with the same error. The pin doesn't avoid the failing path; the resumable flow itself does not work on these runners.

This PR removes the resumable/chunked upload (added in #2140) in favor of a plain single-request upload with execute(num_retries=5). A single-request upload never produces a 308, so the failing code path is gone entirely. Also removes the now-pointless httplib2 diagnostic step from the workflow and trims the stale pin rationale from the requirements file (the pin stays, for reproducibility).

Reviewed trade-offs of dropping resumable:

  • A mid-transfer failure re-uploads the whole AAB instead of one chunk. Acceptable: AABs are ~100 MiB and the outer with_retry (3 attempts, backoff) plus the version-already-committed verification still cover the committed-but-response-lost case.
  • googleapiclient buffers the whole non-resumable body in memory — trivial at AAB sizes on CI runners.
  • The script now logs the AAB size at startup so timeout failures are interpretable against HTTP_TIMEOUT_SECONDS.

Note: deploys currently fail before reaching this step on a separate bug — --silent forwarded into vite build by build:deps (#2158). Both PRs need to land (and reach the release branch) for a deploy to go green end to end.

Test plan

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores

    • Removed a diagnostic verification step from the mobile deployment workflow.
    • Simplified the pinned-dependencies header used for reproducible Play Store uploads.
  • Refactor

    • Streamlined the app bundle upload flow to rely on default upload behavior instead of manual chunk handling.
    • Upload script now reports uploaded AAB size in MiB at startup.

@vercel

vercel Bot commented Jun 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
self-webview-app Ignored Ignored Preview Jun 10, 2026 1:45am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3fd8438c-07ae-41dc-86f6-df530241aac7

📥 Commits

Reviewing files that changed from the base of the PR and between 0d3f402 and d1688f4.

📒 Files selected for processing (2)
  • .github/workflows/mobile-deploy.yml
  • app/scripts/upload_to_play_store.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/scripts/upload_to_play_store.py
  • .github/workflows/mobile-deploy.yml

📝 Walkthrough

Walkthrough

Removes explicit chunked/resumable upload handling (constant + helper) and updates Internal App Sharing and Play Store upload call sites to call execute(...) directly; startup logging now prints AAB size in MiB; CI workflow step verifying httplib2 and the requirements header comment were simplified.

Changes

Android App Bundle Upload Simplification

Layer / File(s) Summary
Upload handler and configuration cleanup
app/scripts/upload_to_play_store.py
Removes UPLOAD_CHUNK_SIZE constant and execute_resumable_upload() helper that previously implemented resumable/chunked uploads with per-chunk progress logging.
Internal App Sharing upload migration
app/scripts/upload_to_play_store.py
Internal App Sharing bundle upload now calls request.execute(num_retries=...) directly instead of using the deleted resumable/chunked upload handler.
Play Store track upload migration
app/scripts/upload_to_play_store.py
Play Store bundle upload now calls upload_request.execute(num_retries=...) directly instead of using the deleted resumable/chunked upload handler.
Startup logging and CI/workflow edits
app/scripts/upload_to_play_store.py, .github/workflows/mobile-deploy.yml, app/scripts/requirements-play-store.txt
Startup logging prints AAB size in MiB; workflow step that verified httplib2 was removed; Play Store requirements header comment was shortened.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: replacing resumable upload with single-request upload in the Play Store upload script.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/play-store-upload-resumable

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR replaces the chunked resumable-upload approach for Play Store AAB uploads with a simpler single-request execute(num_retries=5) call. It also removes the debugging workflow step that verified the httplib2 version and trims the comment in requirements-play-store.txt that explained the pin rationale.

  • upload_to_play_store.py: Removes UPLOAD_CHUNK_SIZE, execute_resumable_upload(), and resumable=True/chunksize from both MediaFileUpload call sites; both IAS and Play Store uploads now call request.execute(num_retries=REQUEST_NUM_RETRIES) directly.
  • .github/workflows/mobile-deploy.yml: Drops the Verify httplib2 version step (was debug-only).
  • requirements-play-store.txt: Keeps all pinned versions but removes the comment explaining why httplib2 was pinned to 0.31.2.

Confidence Score: 4/5

Safe to merge; the simplification is intentional and the core retry/timeout safety nets remain in place.

The upload path now sends the entire AAB in a single HTTP request instead of in 8 MB chunks. On a flaky CI link the full 5-retry budget could be exhausted faster than before, but the 600-second socket timeout and the outer with_retry wrapper give reasonable coverage. The removed comment about the httplib2 pin is a minor maintenance concern. No auth, correctness, or data-integrity issues are introduced.

upload_to_play_store.py warrants a real-world upload run to confirm the non-resumable path completes within the timeout budget for a production-sized AAB.

Important Files Changed

Filename Overview
app/scripts/upload_to_play_store.py Removes chunked resumable upload in favour of a single-shot execute(); retry logic and timeout constants remain intact but progress logging is lost and retries now restart the full transfer.
app/scripts/requirements-play-store.txt Pin versions unchanged; comment explaining the httplib2 constraint removed, leaving future maintainers without context for why 0.31.2 was chosen.
.github/workflows/mobile-deploy.yml Removes the debug-only 'Verify httplib2 version' step; no functional change to the workflow.

Sequence Diagram

sequenceDiagram
    participant CI as GitHub Actions
    participant PY as upload_to_play_store.py
    participant API as Google Play API

    CI->>PY: python upload_to_play_store.py --mode track

    Note over PY: with_retry() wraps entire flow (max 3 attempts)

    PY->>API: edits().insert() — create edit
    API-->>PY: edit_id

    PY->>API: "edits().bundles().upload()<br/>MediaFileUpload (non-resumable)<br/>execute(num_retries=5)"
    Note over API: Full AAB sent in one HTTP request.<br/>execute() retries from scratch on transient errors.
    API-->>PY: bundle_response (versionCode)

    PY->>API: edits().tracks().update()
    API-->>PY: track_response

    PY->>API: edits().commit()
    API-->>PY: commit_response

    PY-->>CI: success / sys.exit(0)

    Note over PY,API: On HttpError with version-already-used:<br/>track_contains_version_code() verifies before treating as success
Loading

Reviews (1): Last reviewed commit: "Merge branch 'dev' into fix/play-store-u..." | Re-trigger Greptile

Comment thread app/scripts/requirements-play-store.txt
Comment thread app/scripts/upload_to_play_store.py

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0d3f402135

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/scripts/upload_to_play_store.py
transphorm and others added 2 commits June 9, 2026 18:41
With the single-request upload, the socket timeout is the binding
constraint; the size makes timeout failures interpretable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@transphorm transphorm changed the title Fix/play store upload resumable fix Play Store upload: replace resumable upload with single-request upload Jun 10, 2026
@transphorm transphorm merged commit 20e465c into dev Jun 10, 2026
36 checks passed
@transphorm transphorm deleted the fix/play-store-upload-resumable branch June 10, 2026 02:53
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