Skip to content

bundle: mas get regression — fails for purchase-history apps not on disk #22270

@wojteksbt

Description

@wojteksbt

PR #21590 switched brew bundle from mas install to mas get, based on @rgoldberg's 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 get <id> returns No downloads initiated for ADAM ID <id> for apps in the Apple ID purchase history but not present on disk, while mas install <id> succeeds for the same id in the same session.

#21559 fixed the fresh-Apple-Account case at the cost of breaking restore-from-purchase-history.

Repro

Pick a free App Store app previously gotten via the UI, delete its .app from /Applications, then:

$ mas --version
7.0.0

$ mas get 1160374471
Error: No downloads initiated for ADAM ID 1160374471

$ mas install 1160374471
==> Downloading PiPifier
==> Installed PiPifier in /Applications/PiPifier.app

brew bundle install with mas "PiPifier", id: 1160374471 fails identically — it invokes mas get via Bundle.system(mas, "get", id.to_s) in Library/Homebrew/bundle/extensions/mac_app_store.rb. Reproduced across multiple free and paid apps.

Suggested fix

The fallback strategy from the #21559 body wasn't taken in #21590:

Try mas install first (fast path for already-associated apps). Fall back to mas get if install fails with the redownload error.

That would cover both fresh accounts and restore-from-purchase-history.

cc @rgoldberg @MikeMcQuaid

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions