Skip to content

fix(mobile): unblock iOS releases and prepare 0.0.36 - #10888

Merged
nwparker merged 2 commits into
mainfrom
nwparker/mobile-release-2
Jul 27, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/mobile-release-2

Conversation

@nwparker

@nwparker nwparker commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Why

Run 30238959540 built an .ipa for ~24 minutes, then Apple rejected the upload:

  • 90186 — train 0.0.34 is closed for new build submissions
  • 90062 — CFBundleShortVersionString [0.0.34] must be higher than the previously approved version 0.0.35

The closed-train guard was supposed to prevent exactly this, but it asked the wrong question. It looked up each candidate's own App Store record:

app.get_app_store_versions(filter: { versionString: version })

A version only gets a record once it is submitted for review. 0.0.34 reached TestFlight but was never submitted — no record, so nothing looked closed and the patch-bump walk stopped there. Meanwhile 0.0.35 shipped, which closes 0.0.34 retroactively: Apple requires a version higher than the last approved one, not merely one that isn't itself released. The guard checked version-by-version; the real constraint is a floor across the whole app.

The same root cause failed run 30169107429 two days earlier, identically.

What changed

fix(mobile): block iOS uploads below the last shipped App Store version

  • highest_closed_app_store_version fetches all versions and takes the highest in a closed state — one call, no per-version filter, so unsubmitted versions no longer create blind spots.
  • closed_train? treats anything <= highest_closed as closed, comparing [major, minor, patch] numerically. A string sort ranks 0.0.9 > 0.0.10, which would break at the next double-digit patch.
  • The guard now reads appVersionState alongside appStoreState. CI runs fastlane 2.237.0, where appStoreState is deprecated as of App Store Connect API 3.3 and the shipped state is renamed READY_FOR_SALE → READY_FOR_DISTRIBUTION. Reading only the old field would silently find zero closed versions once Apple stops populating it — re-breaking this bug in a way that looks like success. respond_to?-guarded, since older spaceship lacks the new field.

The API-error path still degrades to "open" and proceeds, as before — never worse than current behavior.

chore(mobile): prepare 0.0.36

app.json sat at 0.0.32 while 0.0.35 had shipped — four versions of drift, because release versions are resolved on the runner and never committed back. This closes the gap so the checked-in version matches reality, and the iOS release no longer depends on the closed-train walk to find an open version (the walk remains as the safety net).

Android versionCode goes 8 → 9 in the same commit. The version string is shared between platforms, and shipping 0.0.36 with the code that already shipped for 0.0.32 produces an APK that cannot install over the released build. Git history shows this being missed and patched after the fact twice (20ebe858af, d1cc78d5c5), so it is bundled here rather than left as a follow-up.

Testing

  • 11 tests pass via ruby fastlane/ios_release_version_test.rb, already wired into mobile.yml CI. New cases cover the 0.0.34 regression, numeric-vs-lexical ordering, minor/major boundaries, and non-semver input.
  • Simulated the failing run against real App Store shape: resolves 0.0.36 instead of 0.0.34. Verified the closed_state? helper across both field vocabularies (old-gem, new-field-only, and both-nil).
  • node scripts/prepare-android-release.mjs accepts the new state: Prepared Orca Mobile Android 0.0.36 (9).
  • Stale explicit versions now fail fast in the ~1-minute resolve step rather than after a 24-minute build. Normal beta iteration on an unshipped version is unaffected.

Follow-up (not in this PR)

Nothing commits the resolved version back after a release, so app.json will start drifting again from the next release onward. Worth a durable fix — this PR resets the counter but does not change that mechanism.

The closed-train guard looked up each candidate version's own App Store
record, but a version only gets one once it is submitted for review.
0.0.34 reached TestFlight and was never submitted, so it had no record,
nothing looked closed, and the patch-bump walk stopped there — while
0.0.35 had already shipped. Apple rejected the upload after a 24-minute
build (90186 closed train, 90062 needs a higher CFBundleShortVersionString).

Fetch the highest closed version once and treat everything at or below it
as closed, comparing semver numerically so 0.0.10 outranks 0.0.9.

Also read appVersionState alongside appStoreState: the latter is
deprecated in App Store Connect API 3.3 and renames the shipped state to
READY_FOR_DISTRIBUTION, so reading only the old field would silently find
zero closed versions once Apple stops populating it.
@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The release version guard now recognizes READY_FOR_DISTRIBUTION, reads legacy and current App Store state fields, and computes the highest closed version once. Shared SemVer helpers numerically parse, compare, and filter versions. Release preparation uses the highest closed version during resolution and rejects results that are not higher, with expanded tests covering comparison, invalid inputs, and boundary cases. The Expo app version and Android version code were also incremented.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the change and testing, but it misses the template's Screenshots, AI Review Report, Security Audit, and Notes sections. Add the missing template sections and include brief summaries for screenshots, AI review, security audit, and notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title clearly reflects the main change: unblocking iOS releases and preparing version 0.0.36.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

app.json sat at 0.0.32 while 0.0.35 shipped on the App Store, because
release versions are resolved on the runner and never committed back.
Close the four-version drift so the checked-in version matches reality
and the iOS release no longer depends on the closed-train walk to find
an open version.

Bump Android versionCode 8 -> 9 in the same commit: the version is shared
between platforms, and shipping 0.0.36 with the code that already shipped
for 0.0.32 produces an APK that cannot install over the released build.
@nwparker nwparker changed the title fix(mobile): block iOS uploads below the last shipped App Store version fix(mobile): unblock iOS releases and prepare 0.0.36 Jul 27, 2026
@nwparker
nwparker merged commit 3830851 into main Jul 27, 2026
2 checks passed
@nwparker
nwparker deleted the nwparker/mobile-release-2 branch July 27, 2026 08:53
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* fix(mobile): block iOS uploads below the last shipped App Store version

The closed-train guard looked up each candidate version's own App Store
record, but a version only gets one once it is submitted for review.
0.0.34 reached TestFlight and was never submitted, so it had no record,
nothing looked closed, and the patch-bump walk stopped there — while
0.0.35 had already shipped. Apple rejected the upload after a 24-minute
build (90186 closed train, 90062 needs a higher CFBundleShortVersionString).

Fetch the highest closed version once and treat everything at or below it
as closed, comparing semver numerically so 0.0.10 outranks 0.0.9.

Also read appVersionState alongside appStoreState: the latter is
deprecated in App Store Connect API 3.3 and renames the shipped state to
READY_FOR_DISTRIBUTION, so reading only the old field would silently find
zero closed versions once Apple stops populating it.

* chore(mobile): prepare 0.0.36

app.json sat at 0.0.32 while 0.0.35 shipped on the App Store, because
release versions are resolved on the runner and never committed back.
Close the four-version drift so the checked-in version matches reality
and the iOS release no longer depends on the closed-train walk to find
an open version.

Bump Android versionCode 8 -> 9 in the same commit: the version is shared
between platforms, and shipping 0.0.36 with the code that already shipped
for 0.0.32 produces an APK that cannot install over the released build.
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