bundle: try mas install before falling back to mas get#22361
Merged
Conversation
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.
brew lgtm(style, typechecking and tests) with your changes locally?(Ran components individually:
brew tests --only=bundle/mac_app_store --no-parallel14/14 pass,brew styleno new offenses,brew typecheckclean. This is the byte-identical diff already validated for #22271.)AI (Claude Code) drafted the patch and RSpec test based on issue #22270, which I authored after manually reproducing the regression on a fresh macOS 26.5 install. I verified the empirical reproducer myself (
mas get <id>fails wheremas install <id>succeeds for a purchase-history app not on disk). Tests, style, and typecheck were run locally before pushing. No prior AI-assisted PR is open (#22271 is closed).What this fixes
Fixes #22270.
This re-submits #22271 against
main. #22271 was opened againstmaster(stale fork default) and merged there, but the merge-queue protection rule onmainrejected the propagation, so the fix never reachedmain. @MikeMcQuaid asked for a fresh PR withbase=mainso it can go through the merge queue cleanly (#22271 comment). The diff is unchanged.PR #21590 switched
brew bundlefrommas installtomas getbased on the assertion in #21559 that they're equivalent for already-purchased apps. Empirically on macOS 26.5 / mas 7.0.0 this isn't true —mas getreturnsNo downloads initiated for ADAM ID <id>for apps in the Apple ID's purchase history but not present on disk, whilemas installsucceeds for the same id in the same session.This adopts the fallback strategy from the #21559 body that wasn't taken in #21590:
Both scenarios are now covered: purchase-history restore (install succeeds, get not called) and fresh Apple Account (install fails, get takes over).
cc @rgoldberg @MikeMcQuaid