diff --git a/CHANGELOG.md b/CHANGELOG.md index 7315f287c7..38ae575ceb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ This is the log of notable changes to EAS CLI and related packages. ### ๐Ÿ› Bug fixes +- [eas-cli] Fix capability sync failing for App Clip targets with the on-demand install entitlement. ([#4617](https://github.com/expo/eas-cli/pull/4617) by [@janicduplessis](https://github.com/janicduplessis)) + ### ๐Ÿงน Chores - [build-tools] Disable the Argent video watermark in `eas/start_argent_remote_session`. ([#4574](https://github.com/expo/eas-cli/pull/4574) by [@szdziedzic](https://github.com/szdziedzic)) diff --git a/packages/eas-cli/src/credentials/ios/appstore/__tests__/bundleIdCapabilities-test.ts b/packages/eas-cli/src/credentials/ios/appstore/__tests__/bundleIdCapabilities-test.ts index d4c3a9345b..f2ebdff713 100644 --- a/packages/eas-cli/src/credentials/ios/appstore/__tests__/bundleIdCapabilities-test.ts +++ b/packages/eas-cli/src/credentials/ios/appstore/__tests__/bundleIdCapabilities-test.ts @@ -67,6 +67,46 @@ describe(syncCapabilitiesForEntitlementsAsync, () => { ]); }); + it('does not re-enable the on-demand install capability of an App Clip', async () => { + const capabilities = [ + { + id: 'QQT5Y8UUW9_ON_DEMAND_INSTALL_CAPABLE', + attributes: { settings: null, capabilityType: 'ON_DEMAND_INSTALL_CAPABLE' }, + }, + ].map(({ id, attributes }) => new BundleIdCapability(ctx, id, attributes as any)); + const bundleId = createMockBundleId('QQT5Y8UUW9', capabilities); + + const result = await syncCapabilitiesForEntitlementsAsync( + bundleId, + { 'com.apple.developer.on-demand-install-capable': true }, + noBroadcastNotificationOption + ); + + expect(result).toStrictEqual({ enabled: [], disabled: [] }); + expect(bundleId.updateBundleIdCapabilityAsync).not.toHaveBeenCalled(); + }); + + it('does not disable the on-demand install capability of an App Clip when the entitlement is absent', async () => { + const capabilities = [ + { + id: 'QQT5Y8UUW9_ON_DEMAND_INSTALL_CAPABLE', + attributes: { settings: null, capabilityType: 'ON_DEMAND_INSTALL_CAPABLE' }, + }, + ].map(({ id, attributes }) => new BundleIdCapability(ctx, id, attributes as any)); + const bundleId = createMockBundleId('QQT5Y8UUW9', capabilities); + + const result = await syncCapabilitiesForEntitlementsAsync( + bundleId, + { + 'com.apple.developer.parent-application-identifiers': ['$(AppIdentifierPrefix)com.example'], + }, + noBroadcastNotificationOption + ); + + expect(result).toStrictEqual({ enabled: [], disabled: [] }); + expect(bundleId.updateBundleIdCapabilityAsync).not.toHaveBeenCalled(); + }); + it('skips syncing capabilities with settings if they do not contain the expected `enabled` field', async () => { const capabilityJson = { id: 'U78L9459DG_APPLE_ID_AUTH', @@ -509,7 +549,7 @@ describe(syncCapabilitiesForEntitlementsAsync, () => { option: 'ON', }, { - capabilityType: 'ONDEMANDINSTALL_EXTENSIONS', + capabilityType: 'ON_DEMAND_INSTALL_CAPABLE', option: 'ON', }, { diff --git a/packages/eas-cli/src/credentials/ios/appstore/bundleIdCapabilities.ts b/packages/eas-cli/src/credentials/ios/appstore/bundleIdCapabilities.ts index bae4d86736..06b53b9824 100644 --- a/packages/eas-cli/src/credentials/ios/appstore/bundleIdCapabilities.ts +++ b/packages/eas-cli/src/credentials/ios/appstore/bundleIdCapabilities.ts @@ -185,9 +185,12 @@ function getCapabilitiesToDisable( for (const existingCapability of currentCapabilities) { // GC and IAP are always enabled in apps by default so we should avoid modifying them. + // App Clip bundle IDs are created with ON_DEMAND_INSTALL_CAPABLE, and Xcode adds its + // entitlement at signing time, so it is often missing from the local entitlements. if ( existingCapability.isType(CapabilityType.IN_APP_PURCHASE) || - existingCapability.isType(CapabilityType.GAME_CENTER) + existingCapability.isType(CapabilityType.GAME_CENTER) || + existingCapability.isType(CapabilityType.ON_DEMAND_INSTALL_CAPABLE) ) { continue; } diff --git a/packages/eas-cli/src/credentials/ios/appstore/capabilityList.ts b/packages/eas-cli/src/credentials/ios/appstore/capabilityList.ts index 1e07091678..4f517a4247 100644 --- a/packages/eas-cli/src/credentials/ios/appstore/capabilityList.ts +++ b/packages/eas-cli/src/credentials/ios/appstore/capabilityList.ts @@ -539,7 +539,7 @@ export const CapabilityMapping: CapabilityClassifier[] = [ { entitlement: 'com.apple.developer.on-demand-install-capable', name: 'On Demand Install Capable for App Clip Extensions', - capability: CapabilityType.ON_DEMAND_INSTALL_EXTENSIONS, + capability: CapabilityType.ON_DEMAND_INSTALL_CAPABLE, validateOptions: validateBooleanOptions, getSyncOperation: getBooleanSyncOperation, },