Repository navigation
#840 Upload App Store screenshots through the App Store Connect API - #852
Conversation
Adds scripts/store-screenshots/upload-app-store.mjs: validates the rendered iPhone 6.9" and iPad 13" slides, then replaces those screenshot sets on the editable version's en-US localization in file order, waits for processing, and refuses every write other than the screenshot endpoints. --dry-run only reads. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Automated review: 1 finding(s) that 2+ of 3 passes agreed on.
2 finding(s) from a single pass, not posted
scripts/store-screenshots/upload-app-store.mjs:395medium: Reorder PATCH targets a read-only App Store Connect relationship (deepseek-v4.1-flash)scripts/store-screenshots/upload-app-store.mjs:569low: Main-entry guard misses symlinked invocation paths, so the script silently does nothing (glm-5.3-flash)
opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.111
|
|
||
| const PNG_SIG = Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]); | ||
| // PNG colour types 4 (grey + alpha) and 6 (RGBA); App Store Connect rejects alpha. | ||
| const PNG_ALPHA_COLOR_TYPES = new Set([4, 6]); |
There was a problem hiding this comment.
low: Alpha pre-check misses palette PNGs (color type 3) with a tRNS transparency chunk
readPngHeader flags alpha only for PNG colour types 4 and 6. A palette (colour type 3) PNG that carries transparency in a tRNS chunk has a real alpha channel but reports hasAlpha: false, so planTarget declares the folder "ready" and the delete/upload cycle runs. The pre-check exists precisely to avoid Apple rejecting a file after the old screenshots for the display type have already been deleted; this variant defeats it.
Failure scenario: store-screenshots/spectrum/app-store-iphone-6.9/ contains valid-sized PNGs saved as palette PNGs with a tRNS transparency chunk (a palette-based optimizer or export step): planTarget returns ready, the run deletes all existing APP_IPHONE_67 screenshots, uploads, Apple processing rejects the file(s) with an alpha error, the script aborts, and the display type is left with zero screenshots despite the pre-flight validation the PR promises
Found by 2 of 3 passes.
Summary
scripts/store-screenshots/upload-app-store.mjs(npm run store:upload-app-store), run locally withASC_KEY_ID,ASC_ISSUER_IDandASC_API_KEY_PATH.store-screenshots/spectrum/app-store-iphone-6.9/andapp-store-ipad-13/in file-name order. Before any API call it refuses wrong pixel sizes, alpha channels and more than 10 shots. A missing or empty folder skips that device and leaves its set untouched.--versionto choose) and itsen-USlocalization (--locale), deletes the old screenshots for each display type (APP_IPHONE_67,APP_IPAD_PRO_3GEN_129), uploads the new ones, confirms each with its MD5, sets the order, and waits for processing. If Apple rejects a file, it stops with Apple's reason.--dry-runlists what would be deleted and uploaded and refuses all writes.Checks
npm run store:fixture-server:test: 33/33 pass, including 14 new tests that run against an in-memory App Store Connect (auth token signature, folder validation, write allowlist, dry run, set creation, upload order and checksums, a rejected upload).--dry-run.Issue
Risks / Follow-ups
appScreenshotSets/appScreenshotsendpoints in favour of the App Asset Library. They still work, but will need porting eventually.APP_IPHONE_67, 2064×2752 →APP_IPAD_PRO_3GEN_129) comes from Apple's screenshot specifications and the API enum; the first real upload confirms it.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmithwith what you need.