Skip to content

Stop uploading the same screenshot twice - #178

Merged
andiwand merged 3 commits into
mainfrom
dont-upload-screenshots-twice
Aug 19, 2026
Merged

Stop uploading the same screenshot twice#178
andiwand merged 3 commits into
mainfrom
dont-upload-screenshots-twice

Conversation

@andiwand

@andiwand andiwand commented Aug 19, 2026

Copy link
Copy Markdown
Member

1.41's screenshots went up doubled twice. The log says why, and it is not what #177 guessed.

Not one upload failed. All 132 pictures were sent and accepted. What failed is deliver's second pass: it reads the set back from App Store Connect and re-sends anything it cannot find. The store lists a picture a few seconds after it takes it, so what deliver cannot find is only the locales it sent last - sv and tr, at the end of the alphabet, in both apps, in both runs.

The second copy then joins the first, fills the locale to the ten screenshots a set allows, and the rest are dropped:

tr/ipad-01-browser.png is missing on App Store Connect.     <- it was not
Failed to upload all screenshots... Tries remaining: 4
Too many screenshots found for device 'APP_IPAD_PRO_3GEN_129' in 'tr',
  skipping this one (tr/ipad-05-pdf.png)                    <- dropped
[..]: Successfully uploaded all screenshots                 <- green

So the locale ends up doubled and short, and the job passes.

Stop sending a second copy

The Fastfile patches Deliver::UploadScreenshots#retry_upload_screenshots_if_needed to wait and look again - six times, thirty seconds apart, asking the store fresh each time - and to fail loudly if a picture is still missing after that. It never sends a second copy.

Exercised against the real deliver 2.237.0:

store lists them outcome re-uploaded
first look returns, no wait no
third look returns after two waits no
never fails the job after three minutes no

The listing check from #177 stays as a backstop, in case a fastlane upgrade moves what is patched, and now also catches Too many screenshots found, which is how the dropped pictures were silent.

Repair without photographing anything again

A release can now be started with screenshots_from_run set to an earlier run's id. Only the two listing jobs run, against that run's framed artifact. Nothing is built, photographed, uploaded or tagged, no build number is spent, and it takes about five minutes instead of forty.

Since the lane clears each locale before it uploads, that repairs a set however it got broken. It is how 1.41's screenshots get fixed: merge this, then dispatch with version 1.41 and screenshots_from_run 32182462133.

Not the beta sync flag

deliver's sync_screenshots was considered. It diffs local against remote instead of clearing first, which sounds like the right shape, but it computes local - remote from the same freshly-fetched listing and so carries the identical race. Its comparison key is locale/filename/checksum with no position, so Array#- deletes both copies of a duplicate before re-uploading one - it converges, but through a pass where the locale is empty. It is beta, gated behind FASTLANE_ENABLE_BETA_DELIVER_SYNC_SCREENSHOTS, and announces it may break. Not worth it when the plain path is deterministic once the retry is gone.

🤖 Generated with Claude Code

deliver sends every picture, then reads the set back from App Store
Connect and sends again whatever it cannot find. The store lists a
picture a few seconds after it takes it, so what deliver cannot find is
just the locales it sent last. The second copy joins the first, fills
the locale to the ten pictures the store allows, and the rest are
dropped - leaving it both doubled and short, while the run reports
success.

No upload has failed; only the reading back has. So wait and read again,
up to three minutes, and if a picture really is missing, stop and say so
rather than sending another.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W2XM93Raj1jyvUuYmpQrcz

@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: 0db3a9d77d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread fastlane/Fastfile
andiwand and others added 2 commits August 19, 2026 08:12
Naming an earlier run in screenshots_from_run runs the two listing jobs
alone, against that run's framed artifact. Nothing is built,
photographed, uploaded or tagged, and no build number is spent.

The lane clears each locale before it uploads, so this repairs a set
however it got broken, without a quarter hour of simulators to take the
same pictures again.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W2XM93Raj1jyvUuYmpQrcz
Six looks thirty seconds apart is five waits, not six, so the last one
came at 150 seconds while the error reported 180. One look more.

The README had grown four paragraphs about screenshots going up twice.
Why deliver does it belongs next to the code that stops it, so the
README keeps what a reader has to do and drops the rest.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W2XM93Raj1jyvUuYmpQrcz
@andiwand
andiwand merged commit 7a61a0e into main Aug 19, 2026
6 of 8 checks passed
@andiwand
andiwand deleted the dont-upload-screenshots-twice branch August 19, 2026 06:18
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