[eas-cli] Fix credentials manager failing on simulator build profiles - #4183
Open
giaBaoJS wants to merge 1 commit into
Open
[eas-cli] Fix credentials manager failing on simulator build profiles#4183giaBaoJS wants to merge 1 commit into
giaBaoJS wants to merge 1 commit into
Conversation
giaBaoJS
force-pushed
the
fix-ios-credentials-simulator-profile-push-key
branch
from
August 13, 2026 14:00
4b98d4e to
f347b86
Compare
|
Subscribed to pull request
Generated by CodeMention Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead. |
Push keys and App Store Connect API keys are app-level credentials and do not depend on the build distribution type, but `eas credentials` resolved the iOS distribution type up front for every project-scoped action. On a build profile with `ios.simulator: true` that resolution throws, so managing those credentials failed with "A simulator distribution does not require credentials to be configured.". Resolve the distribution type lazily, so only the actions that consume it (credentials.json sync, distribution certificate and provisioning profile actions) are gated by that check. Fixes expo#4109
giaBaoJS
force-pushed
the
fix-ios-credentials-simulator-profile-push-key
branch
from
August 18, 2026 15:06
f347b86 to
9c8a8a4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Fixes #4109.
In the interactive
eas credentialsflow for iOS, picking a build profile withios.simulator: truemakes every project-scoped action other than "All: Set up all the required credentials to build your project" fail with:The reported case is Push Notifications → Set up your project to use Push Notifications, which fails even though the same profile's build credentials (distribution certificate + ad hoc provisioning profile) were created successfully moments earlier in the same session.
Push keys and App Store Connect API keys are app-level credentials — they are registered per app, not per build distribution type — so they should not be gated by the simulator check at all. The same profile shape (
distribution: "internal"+ios.simulator: true) is the documented pattern for development-client builds that also target the simulator, so this is easy to hit.How
ManageIos.runProjectSpecificActionAsyncresolved the distribution type eagerly for every action exceptSetUpBuildCredentials(which has its own early return), andSelectIosDistributionTypeGraphqlFromBuildProfile.runAsyncthrows wheneverbuildProfile.simulatoris set. But only a subset of the actions ever read that value.Enumerating every project-scoped
IosActionTypethat reaches this method:distributionType?SetUpBuildCredentialsSetUpBuildCredentialsFromCredentialsJsonUpdateCredentialsJsonUseExistingDistributionCertificateCreateDistributionCertificateRemoveProvisioningProfileSetUpPushKeyCreatePushKeyUseExistingPushKeySetUpAscApiKeyForSubmissionsUseExistingAscApiKeyForSubmissionsCreateAscApiKeyForSubmissionsThe eager resolution is replaced with a lazy one that each branch awaits only when it actually needs the value. That keeps the simulator guard in place for the five actions that genuinely depend on a distribution type, and unblocks the six app-level ones. This is the first option suggested in the issue.
SelectIosDistributionTypeGraphqlFromBuildProfileitself is unchanged — the simulator throw is intentional for that class and its existing test still passes untouched.Test Plan
New unit tests in
packages/eas-cli/src/credentials/manager/__tests__/ManageIos-test.ts:SetUpPushKeyon a{ distribution: 'internal', simulator: true }profile now runsSetUpPushKeywith the right app lookup params (the exact scenario from the issue).UpdateCredentialsJsonon a{ distribution: 'store' }profile still receivesIosDistributionType.APP_STORE, so the fix cannot degenerate into "never resolve a distribution type".UpdateCredentialsJsonon a simulator profile still rejects withA simulator distribution does not require credentials to be configured.and never constructsUpdateCredentialsJson.Counterfactual check — with the change to
ManageIos.tsreverted and the new tests kept, the 7 simulator cases fail with exactlyA simulator distribution does not require credentials to be configured., while the 2 guard tests stay green:With the change applied:
Full
packages/eas-clisuite, before and after:The two failing suites (
src/observe/__tests__/formatCustomEvents.test.ts,src/observe/__tests__/formatEvents.test.ts) fail identically on an unmodifiedmain— they are locale-dependent date-format snapshots unrelated to this change.yarn typecheck,yarn lint(0 errors) andyarn fmt:checkare clean.