Skip to content

Commit 8ed276c

Browse files
fix(mobile): production OTAs no longer reach the previous major's store binaries (#14944)
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 6414268 commit 8ed276c

3 files changed

Lines changed: 25 additions & 3 deletions

File tree

‎.github/workflows/mobile-eas-production.yml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ name: Mobile EAS Production
1818
# Store stays a manual App Store Connect step.
1919
# 2. OTA: publish a production-channel update for each platform where at
2020
# least one finished production build matches the current native
21-
# fingerprint. Old-version binaries with a matching fingerprint receive
22-
# it too. When native drift means no binary could install the update,
21+
# fingerprint. Older binaries of the same major version with a matching
22+
# fingerprint receive it too; the major version is part of the
23+
# fingerprint (apps/mobile/fingerprint.config.js), so a new major never
24+
# reaches the previous major's store binaries over the air. When native
25+
# drift means no binary could install the update,
2326
# it is skipped and flagged in the job summary instead of published
2427
# into the void.
2528
# workflow_dispatch remains as a manual override for both modes (e.g. to

‎apps/mobile/fingerprint.config.js‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// @ts-check
2+
const fs = require("node:fs");
3+
const path = require("node:path");
4+
5+
// Expo's fingerprint ignores the app version, so binaries of different majors
6+
// share a runtime version whenever native code is unchanged, and a production
7+
// OTA from main would reach every older store binary. Hashing the major
8+
// version keeps each major's OTAs on its own binaries: a new major reaches
9+
// users only once its store build is promoted.
10+
const appConfig = fs.readFileSync(path.join(__dirname, "app.config.ts"), "utf8");
11+
const majorVersion = appConfig.match(/^ {2}version: "(\d+)\./m)?.[1];
12+
if (!majorVersion) {
13+
throw new Error("fingerprint.config.js could not read the app version from app.config.ts");
14+
}
15+
16+
module.exports = {
17+
extraSources: [{ type: "contents", id: "appMajorVersion", contents: majorVersion }],
18+
};

‎knip.jsonc‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@
6666
"ignoreIssues": { "src/components/ui/*.tsx": ["exports", "nsExports", "duplicates"] },
6767
},
6868
"apps/mobile": {
69-
// Expo loads plugins by string; Metro embeds the browser entry in the native WebView.
69+
// Expo loads plugins and the fingerprint config by string; Metro embeds the browser entry in the native WebView.
7070
"entry": [
7171
"index.ts!",
72+
"fingerprint.config.js",
7273
"plugins/*.cjs",
7374
"scripts/generate-device-stream.mts",
7475
"src/features/devices/device-stream.browser.ts!",

0 commit comments

Comments
 (0)