Skip to content

[eas-cli] Stop looping forever when device registration adds no devices - #4254

Open
dennytosp wants to merge 1 commit into
expo:mainfrom
dennytosp:fix/device-registration-infinite-loop
Open

[eas-cli] Stop looping forever when device registration adds no devices#4254
dennytosp wants to merge 1 commit into
expo:mainfrom
dennytosp:fix/device-registration-infinite-loop

Conversation

@dennytosp

Copy link
Copy Markdown

Why

Fixes #2059.

SetUpAdhocProvisioningProfile runs the device registration action once and then loops until at least one device shows up. The loop only ever pauses for the Website method, where the CLI waits for a key press between reads. Every other method registers whatever it can before returning, so when it registers nothing the loop just rereads the same empty list as fast as the network allows:

  • Developer Portal with no devices on the portal logs "All your devices registered on Apple Developer Portal are already imported to EAS." and returns normally.
  • Developer Portal when the user deselects every device in the import multiselect.
  • Current Machine when the user answers "no" to "Is this what you want to register?".

In all three the CLI prints "There are still no registered devices." forever and hammers getDevicesForAppleTeamAsync (which is called with useCache: false) until the user kills the process. That is exactly what the issue reports for the Developer Portal case.

How

Only the Website method keeps looping, since it is the only one where devices are registered out of band and waiting can actually change the answer. When any other method leaves the list empty, the command now fails with a message pointing at eas device:create instead of spinning. The Input method keeps its existing, more specific error.

Test Plan

yarn test, yarn typecheck, yarn lint and yarn fmt:check all pass.

Four unit tests were added around registerDevicesAsync. Without the fix, gives up when the developer portal method registers nothing never resolves and the suite times out; with it, the call rejects after a single read of the device list. The website test still loops and returns the devices once they appear, so the wait-and-retry behaviour is unchanged.

@dennytosp
dennytosp force-pushed the fix/device-registration-infinite-loop branch from 5808bf2 to 4c23fef Compare August 22, 2026 08:50
@github-actions

Copy link
Copy Markdown

Subscribed to pull request

File Patterns Mentions
packages/eas-cli/** @douglowder

Generated by CodeMention

Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Infinite loop on choosing registered devices when there are none

1 participant