Game Center switch before submit: apple submit / resubmit and signing ensure create gameCenterDetails and gameCenterAppVersions when Game Center is in use (config, entitlements or the built IPA), shown in the dry run; validate blocks on either missing; fake 409 BUILD_INDICATES_GAME_CENTER_ENABLED until both exist; pitfall 89

This commit is contained in:
CRTkafa 2026-10-21 05:33:53 +07:00
parent dd9e059036
commit 163e666834
9 changed files with 152 additions and 26 deletions

View file

@ -134,6 +134,9 @@ export class FakeAsc {
lag: Record<string, number> = {};
/** every uploaded part, by asset id */
parts: string[] = [];
/** The attached builds carry com.apple.developer.game-center: submitting answers Apple's 409 (seen live) until the
* app has a gameCenterDetail and the version a gameCenterAppVersion. */
gameCenterBuild = false;
constructor(readonly appId = '6400000101') {
this.put({ type: 'apps', id: appId, attributes: { bundleId: 'com.example.notes', name: 'Example Notes' }, rels: {} });
@ -335,6 +338,13 @@ export class FakeAsc {
// seen live (2026-10-12): a REJECTED item that is not marked resolved blocks every submit with this 409, and an
// empty draft cannot be canceled
const items = this.children(self.id, 'reviewSubmissionItems');
if (attrs.submitted && this.gameCenterBuild) {
const app = String(self.rels.app);
const ver = items.map(it => String(it.rels.appStoreVersion ?? '')).find(Boolean);
if (!this.children(app, 'gameCenterDetails').length || (ver && !this.children(ver, 'gameCenterAppVersions').length))
return json({ errors: [{ status: '409', code: 'STATE_ERROR.BUILD_INDICATES_GAME_CENTER_ENABLED', title: 'The request cannot be fulfilled because of the state of another resource.',
detail: 'The build for this app store version has com.apple.developer.game-center entitlement but appStoreVersion is missing gameCenterConfigurations relationship.' }] }, 409);
}
if (attrs.submitted && items.some(it => it.attributes.state === 'REJECTED'))
return json({ errors: [{ status: '409', code: 'STATE_ERROR', title: 'The request cannot be fulfilled because of the state of another resource.', detail: 'Version is not ready to be submitted yet, please try again later' }] }, 409);
if (attrs.canceled && self.attributes.state === 'READY_FOR_REVIEW' && !items.length)