Play 'Live' only when the public store page proves it: play status checks https://play.google.com/store/apps/details?id=<pkg> (no auth, 4 s timeout, cached 5 min; publicPage in the JSON), a completed production release with a 404 page is 'Sent to Google (in review or not yet published)', 200 is live for the first release or when the page shows the versionName, otherwise 'Released to production (Google may still be reviewing)', offline is unknown; new phases sent / released in the desktop Releases tab, Portfolio, release status | plan; versions matched across the stores without trailing .0 parts (App Store 1.0 and Play 1.0.0 are one row and one train, each side shows its own string); tests/play-public-version-match.test.ts, desktop boot check release-state cases (page 404 and 200) (pitfall 56)

This commit is contained in:
CRTkafa 2026-10-13 20:46:48 +08:00
parent aa72204a06
commit be9ff8b788
18 changed files with 436 additions and 30 deletions

View file

@ -103,3 +103,23 @@ export const PLAY_STATUS = {
],
listings: [], products: [],
};
// A first release in the shapes the stores really answered (pitfall: App Store "1.0" in review while Google Play's
// production release of "1.0.0" reads "completed" but the app is not public yet). `play status --json` adds the public
// store page check (publicPage): 404 = not public yet, 200 = published.
export const APPLE_STATUS_FIRST_REVIEW = {
app: { id: '1000000002', attributes: { name: 'Prism Puddle', bundleId: 'com.example.prismpuddle' } },
versions: [version('ver-10', '1.0', 'WAITING_FOR_REVIEW', 'b-3')],
builds: [build('b-3', '3', 'VALID', '2026-10-10T09:00:00Z', 'pre-10')], attachedBuilds: [], buildVersions: { 'b-3': '1.0' },
iaps: [], phased: {}, subs: [{ id: 'rs-10', attributes: { state: 'WAITING_FOR_REVIEW', submittedDate: '2026-10-10T10:00:00Z' } }], unresolved: [], emptyDrafts: [],
};
const playFirst = (state: 'public' | 'notPublic') => ({
...PLAY_STATUS,
tracks: [
{ track: 'production', releases: [{ name: '1.0.0', versionCodes: ['3'], status: 'completed', userFraction: 1 }] },
{ track: 'internal', releases: [{ name: '1.0.0', versionCodes: ['3'], status: 'completed' }] },
],
publicPage: { state, http: state === 'public' ? 200 : 404, versionName: null, checkedAt: '2026-10-13T08:00:00Z', url: 'https://play.google.com/store/apps/details?id=com.example.prismpuddle&hl=en' },
});
export const PLAY_STATUS_FIRST_404 = playFirst('notPublic');
export const PLAY_STATUS_FIRST_200 = playFirst('public');