mas icon indicating copy to clipboard operation
mas copied to clipboard

🐛 [BUG] mas confuses macOS and iOS/iPadOS apps

Open rgoldberg opened this issue 3 years ago • 22 comments

Your Environment

  • mas version: 1.8.1
  • macOS version (system_profiler SPSoftwareDataType -detailLevel mini): 11.2.3 (20D91)

mas Install Method

  • [X] brew install mas (homebrew-core)
  • [] mas-cli/tap
  • [] .pkg installer from releases
  • [] Built from source
    • Fork/branch: ? (e.g. mas-cli/master)
    • Xcode version: 10.?

Describe the Bug

This is probably a problem with Apple's store APIs, not with mas.

Apple released Pages, Numbers & Keynote 11.0 on 2021-03-22.

mas commands list the current store version of each of them as 10.3.9, which is the version that is installed on my machine.

The App Store GUI doesn't show these as updates in the "Updates" tab, and the apps have Open buttons (instead of Update buttons) in my Account tab Purchased section.

If I look at the pages for these 3 apps in the App Store GUI, or see them in search results, then they have Update buttons (instead of Open buttons). After seeing an Update button for one of these apps, the Open button in the Purchased section of the Account tab becomes am Update button until I close & reopen the App Store GUI.

To Reproduce

Steps to reproduce the behavior:

  1. See description above

Expected Behavior

mas indicates that the store versions of Pages, Numbers & Keynote are now 11.0

Even though the App Store GUI is inconsistent, it would be nice if mas could be better than the GUI.

Actual Behavior

mas indicates that the store versions of Pages, Numbers & Keynote are still 10.3.9

Screenshots, Terminal Output

rgoldberg avatar Mar 23 '21 18:03 rgoldberg

Screenshot of iTerm2 (25-03-2021, 23-33-26)

▐λ▍mas outdated
1026349850 Copied (4.0.1 -> 4.0.4)
430255202 Mactracker (7.10.3 -> 7.10.4)
360593530 Notability (10.3.1 -> 10.3.2)
571213070 DaVinci Resolve (17.1.0 -> 17.1)
922765270 LiquidText (1.1.8 -> 4.1.0)

▐λ▍mas upgrade --help
Unrecognized arguments: --help

▐λ▍mas help upgrade
Upgrade outdated apps from the Mac App Store

[[]]
	app(s) to upgrade

▐λ▍man mas
No manual entry for mas

▐λ▍mas upgrade help
Warning: Nothing found to upgrade

▐λ▍mas help upgrade
Upgrade outdated apps from the Mac App Store

[[]]
	app(s) to upgrade

▐λ▍mas upgrade 1026349850
Upgrading 1 outdated application:
Copied (4.0.1)
==> Downloading Copied
==> Installed Copied

haakonstorm avatar Mar 25 '21 22:03 haakonstorm

Investigating, for app Copied (MAS id #1026349850) it is reported installed version is v4.0.1 and latest is v4.0.4. Upgrading, app is "upgraded" but stays on same version. Checking the iOS/iPadOS counterpart, "Copied Touch", this is in fact on v4.0.4. I'm running Big Sur on arm64, where MAS is capable of fetching iOS/iPadOS releases. Appears mas-cli conflate releases somehow.

The strange thing is with release 571213070 DaVinci Resolve tho. This is macOS only. DaVinci Resolve.app via "get info" is reported at 17.1.0. Screenshot of Finder (25-03-2021, 23-41-09)

Screenshot of iTerm2 (25-03-2021, 23-47-29)

haakonstorm avatar Mar 25 '21 22:03 haakonstorm

This is great info @haakonstorm! I thought that mas only searched for macOS apps, but I may be remembering how search, lookup and info work. I wonder if this is an issue that affects "universal" apps which I believe can have a different version per platform.

phatblat avatar Mar 29 '21 02:03 phatblat

Is it possible to use mas-cli in "raw" form somehow with JSON to talk to the API? I could see if I could help debug this. (Unrelated: I originally came here to find a way to list all MAS apps: (id, name, description) in the same way homebrew does, preferably also with JSON output; is this possible?)

haakonstorm avatar Mar 30 '21 09:03 haakonstorm

The issues with outdated showing out-of-date information for macOS apps should be resolved with #345 and #346.

Let's use this issue to track the confusion mas experiences between macOS, iOS, and iPadOS apps on M1 Macs, where all are "available for purchase".

An additional test case is here.

chris-araman avatar Apr 27 '21 05:04 chris-araman

Great work! Going to test now. update: Small snafu: first call to mas list comes up empty. Subsequent calls succeed:

Screenshot of iTerm2 (27-04-2021, 17-25-37)

haakonstorm avatar Apr 27 '21 15:04 haakonstorm

Just updated to macOS 11.3 (you should too!)

Zero outdated via App Store.app

Screenshot of App Store (27-04-2021, 17-27-52)

mas finds outdated apps and errors on Copied.app

Screenshot of iTerm2 (27-04-2021, 17-49-59)

Copied.app is both multiarch and macOS/iPadOS ready, but investigating, something amiss but probably local to this App only (pulled from the App store? App certificates still a-okay. Awesome app. Non-existing support.)

md5 before and after mas upgrade

Screenshot of iTerm2 (27-04-2021, 19-04-52)

Perhaps Gifox was actually updated in App Store in the interim.

haakonstorm avatar Apr 27 '21 17:04 haakonstorm

Searching for Gifox in MAS, isn't found?

Screenshot of App Store (27-04-2021, 19-08-12)

Neither macOS or iPadOS/iOS version appears. Clicking the MAS "story" yields "Gifox 2" and a product page is found.

Searching for "Copied" in MAS yields another "story" page, but the Copied app is not listed.

I attribute this to bugs in macOS 11.3 installed just an hour ago. Tried logging in and out. Will reboot now, clear caches by keeping shift ⇧ while booting up then reboot again. BRB

haakonstorm avatar Apr 27 '21 17:04 haakonstorm

@haakonstorm, I wonder whether these apps may have been removed from the App Store, or may have been removed from sale in the region of your Apple ID. If available for iOS or iPadOS, might they have been initially installed as an iOS/iPadOS app but later marked by the developer as not discoverable on macOS?

chris-araman avatar Apr 27 '21 22:04 chris-araman

Can you try manually searching for Gifox in App Store.app, then try mas search gifox and mas open 1461845568 please?

Screenshot of iTerm2 (28-04-2021, 01-47-33)

haakonstorm avatar Apr 27 '21 23:04 haakonstorm

Here, mas provides more features than MAS.app because MAS actually do not provide all results.

I will also do some more digging, as some of these can also happen to be installed via brew install --cask, hence the apparent "downgrades" as seen above, when parsed through mas-cli.

haakonstorm avatar Apr 27 '21 23:04 haakonstorm

Btw JSON output from mas-cli (raw, or something) would be super nice!

haakonstorm avatar Apr 27 '21 23:04 haakonstorm

@haakonstorm JSON output was proposed in mas-cli/mas#190. I have it tentatively slated for a future 2.0 release.

phatblat avatar Apr 28 '21 01:04 phatblat

A similar thing happens with DaisyDisk (411643860) and 1Blocker (1365531024) on an M1 mac too: both are continuously listed as outdated, but the mac app store pages for both list the version that's installed. For 1Blocker, I'm pretty sure it's the iOS version that's newer than the macOS version.

For DaisyDisk though, the situation is even weirder: Here's the output from mas outdated:

$ mas outdated
411643860 DaisyDisk (4.12.1 -> 4.12)
1365531024 1Blocker (3.15.1 -> 4.0)

It's thinks it needs to upgrade DaisyDisk from 4.12.1 to 4.12 (actually a downgrade!), and when I run that upgrade, this happens:

mas upgrade DaisyDisk
Upgrading 1 outdated application:
DaisyDisk (4.12.1)
==> Downloading DaisyDisk
==> Installed DaisyDisk
$ mas outdated
411643860 DaisyDisk (4.12.1 -> 4.12)
1365531024 1Blocker (3.15.1 -> 4.0)

(All the while, DaisyDisk stays at version 4.12.1, as I think it should... unless the version got pulled from the App Store and people ought to downgrade, I guess...)

antifuchs avatar Apr 30 '21 19:04 antifuchs

Thanks for the additional information, @antifuchs!

The scenario you describe with DaisyDisk should be addressed by #346. We'll keep using this issue (#336) to track the scenario with the 1Block, which I agree seems to be due to confusion in mas between iOS and macOS apps.

chris-araman avatar Apr 30 '21 19:04 chris-araman

Is there any update on this from the CLI front? I've been using mas with homebrew bundles, and every run of that since April has taken far longer than a "no updates" run would due to mas attempting to upgrade 1Blocker. Is there anything that would make it possible to detect that no update is available on the platform where we're running the command?

antifuchs avatar Nov 28 '21 12:11 antifuchs

@antifuchs, please see Known Issues.

chris-araman avatar Dec 01 '21 01:12 chris-araman

I just encountered the same issue on macOS 12.2.1 with mas 1.8.6:

mas shows that Instapaper is outdated, but 8.0.1 is the latest version available for macOS, only iOS has a 8.1 version.

❯ mas outdated
288545208 Instapaper (8.0.1 -> 8.1)

❯ mas help upgrade
Upgrade outdated apps from the Mac App Store

[[]]
	app(s) to upgrade

❯ mas upgrade 288545208
Upgrading 1 outdated application:
Instapaper (8.0.1)
==> Downloading Instapaper
==> Installed Instapaper

❯ mas outdated
288545208 Instapaper (8.0.1 -> 8.1)

quinncomendant avatar Feb 28 '22 21:02 quinncomendant

Hi,

I have the same issue with https://apps.apple.com/app/broadcasts/id1469995354

However, another source of information may be available through the web appstore pages: the applicaiton metadata are embedded as json in the html page in a

curl "https://apps.apple.com/app/broadcasts/id1469995354" | tr -d '\n' | sed -e's:.*<script type="fastboot/shoebox" id="shoebox-media-api-cache-apps">::' -e's:</script>.*::' | jq 'to_entries|.[0].value|fromjson'

The actual osx version can be extracted as follows:

curl "https://apps.apple.com/app/broadcasts/id1469995354" | tr -d '\n' | sed -e's:.*<script type="fastboot/shoebox" id="shoebox-media-api-cache-apps">::' -e's:</script>.*::' | jq 'to_entries|.[0].value|fromjson|.d[0].attributes.platformAttributes.osx.versionHistory[0].versionDisplay'

=> "2.2.7"

The actual ios version can be extracted as follows

curl "https://apps.apple.com/app/broadcasts/id1469995354" | tr -d '\n' | sed -e's:.*<script type="fastboot/shoebox" id="shoebox-media-api-cache-apps">::' -e's:</script>.*::' | jq 'to_entries|.[0].value|fromjson|.d[0].attributes.platformAttributes.ios.versionHistory[0].versionDisplay'

=> "2.3.3"

Perhaps these metadata could be used for a better handling of macOS vs iOS versions.

nicerloop avatar Jun 02 '22 14:06 nicerloop

Version per platform can be collected with following command:

curl "https://apps.apple.com/app/broadcasts/id1469995354" | tr -d '\n' | sed -e's:.*<script type="fastboot/shoebox" id="shoebox-media-api-cache-apps">::' -e's:</script>.*::' | jq ' to_entries | .[0].value | fromjson | .d[0].attributes.platformAttributes | to_entries[] | { platform: .key , version : .value.versionHistory[0].versionDisplay } ' => { "platform": "osx", "version": "2.2.7" } { "platform": "ios", "version": "2.3.3" } { "platform": "appletvos", "version": "2.3" }

nicerloop avatar Jun 03 '22 09:06 nicerloop

Created feature request for enhancement: https://github.com/mas-cli/mas/issues/468

nicerloop avatar Jun 28 '22 14:06 nicerloop

An alternative solution, using the currently unused platform query string parameter for the JSON endpoint currently used to determine the current version of an app. We would need to find the platform value that works for Macs, as the only known working values are ipad, iphone & ipod.

https://github.com/mas-cli/mas/issues/468#issuecomment-1245235037

rgoldberg avatar Sep 13 '22 10:09 rgoldberg

I've published a build with a potential fix (#505) for this on the releases page: https://github.com/mas-cli/mas/releases/tag/v1.8.7-beta.1

Could I get some volunteers to install the .pkg attached to that release to see if this resolves any of these issues?

phatblat avatar Nov 29 '23 03:11 phatblat