Repository navigation
feat(install): support custom bundle identifier in Apple ID mode - #209
Merged
Merged
Conversation
The signing engine accepts --custom-identifier together with --apple-id, but every entry point refused the combination. Worse, an Apple ID record was keyed by the bundle identifier of the IPA and the account, so installing the same IPA with and without a custom identifier collapsed into a single record and the second install overwrote the identifier of the first. Key the record by the bundle identifier actually installed on the device (COALESCE of signed_bundle_identifier, custom_identifier and bundle_identifier, so the columns AutoMigrate leaves NULL on existing rows are ignored) and pass the identifier to the engine in both signing modes. A refresh passes it again: the stored IPA still carries the original bundle identifier, so without it the app would be refreshed under another App ID. The install is thus a second app on the device, with its own record, App ID and expiry. Also keep the identifier when the MCP tool queues an Apple ID install (it validated the value but stored it only for external certificates) and add it to the install queue key, so two installs of the same IPA under different identifiers are both queued. The install page shows the field in both modes in the tooltip style of the app name field, previews the identifier of the chosen IPA, and validates it before submitting.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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
The signing engine already accepts
--custom-identifiertogether with--apple-id, but every entry point refused the combination, so Apple ID installs could not use a custom bundle identifier at all.Worse, an Apple ID record was keyed by the bundle identifier of the IPA plus the account. Installing the same IPA with and without a custom identifier therefore collapsed into a single record, and the second install silently overwrote the identifier of the first.
How
Key the record by the app actually on the device. The Apple ID match key becomes
COALESCE(NULLIF(signed_bundle_identifier,''), NULLIF(custom_identifier,''), bundle_identifier), so a custom identifier gives the install its own record.NULLIFmatters: columns added by AutoMigrate are NULL on existing rows, not empty. This mirrors what external certificate records already did, so both modes now agree.Pass the identifier to the engine in both modes, including the refresh path. A refresh re-signs the stored IPA, which still carries the original bundle identifier — without the flag the app would be refreshed under another App ID.
Open the three entry points (
/api/install, the/ws/installmessage, the MCPinstall_apptool) and validate the identifier there instead of rejecting it.Two latent bugs fixed on the way
custom_identifierbut stored it only for external certificates, so an Apple ID install would have passed validation and then dropped the value.installOperationKeydid not include the identifier, so two installs of the same IPA under different identifiers were treated as duplicates and the second was dropped.UI
The field is now shown in both modes, using the tooltip style of the app name field, and the placeholder previews the bundle identifier of the chosen IPA (read in the browser for a picked file, since an Apple ID install never reaches the server before the install is queued). The identifier is validated before submitting, and the home page shows it so two records sharing a bundle identifier can be told apart.
Testing
TestStartAppleIDPassesCustomIdentifierdrivesstartAppleIDagainst a fake engine and asserts the argument for install, refresh and no-identifier cases. Removing the wiring makes it fail.TestSaveAppKeepsSigningModesApartgrows from 10 to 17 cases covering Apple ID custom/plain splits and legacy rows whose added columns are NULL. Itshistoricalhelper now NULLs every added column, not justsigning_mode.TestNewInstallRecordKeepsCustomIdentifiercovers the MCP regression above.golangci-lintclean, full Go suite green, 70 frontend tests green.Note for the reviewer
The engine flag combination is new to this project, and CI pins
plumesignv2.2.3-patch.9 while this was developed against 2.2.2. Please confirm on real hardware that an Apple ID install with a custom identifier registers the App ID and installs as expected before merging. Also worth noting: each distinct identifier consumes another App ID slot, and there is currently no dedicated error for exhausting that quota.