Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/eas-cli/src/credentials/ios/appstore/bundleId.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BundleId, Profile, RequestContext } from '@expo/apple-utils';
import { BundleId, Profile, ProfileState, RequestContext } from '@expo/apple-utils';

async function getProfilesForBundleIdDangerousAsync(
context: RequestContext,
Expand All @@ -15,7 +15,12 @@ export async function getProfilesForBundleIdAsync(
context: RequestContext,
bundleIdentifier: string
): Promise<Profile[]> {
const profiles = await getProfilesForBundleIdDangerousAsync(context, bundleIdentifier);
// Only work with active provisioning profiles, we can't use expired or invalid profiles
// Once a profile expired or is marked as invalid, it cannot change back to active, making cache poisoning irrelevant here
const profiles = await getProfilesForBundleIdDangerousAsync(context, bundleIdentifier).then(
profiles => profiles.filter(profile => profile.attributes.profileState === ProfileState.ACTIVE)
);

// users sometimes have a poisoned Apple cache and receive stale data from the API
// we call an arbitrary method, `getBundleIdAsync` on each profile
// if it errors, the profile was stale, so we remove it
Expand Down
Loading