mas icon indicating copy to clipboard operation
mas copied to clipboard

Some apps are always shown as outdated even though they're already the latest version (CFBundleShortVersionString vs. CFBundleVersion)

Open luispuerto opened this issue 4 years ago • 20 comments

Your Environment

  • mas version: 1.8.2
  • macOS version (system_profiler SPSoftwareDataType -detailLevel mini): 11.3.1 (20E241)

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

Ninja Cookie gets updated from 0.7 to 0.7.1, but if I run mas upgrade it updates again because mas outdated still show it as outdated. On other words, just seem that or mas is not able to read the version of the app properly, or the app doesn't states its version properly. I think it's the latter one.

To Reproduce

Steps to reproduce the behavior:

  1. Install Ninja Cookie 1535219336
  2. mas outdated or mas upgrade
  3. See that Ninja Cookie upgrades every time

Expected Behavior

Detect the version properly?

Actual Behavior

Upgrade, upgrade, upgrade

Additional Context

Perhaps it would be great to have a pin command or ignore this version or something.

luispuerto avatar May 18 '21 08:05 luispuerto

I also get this for 1Blocker 3.16 and Endel 2.3.264.

Not sure if these should go in separate issues as application specific or if it's a general mas bug?

lougreenwood avatar May 18 '21 14:05 lougreenwood

@lougreenwood I don't know either and at least in the case of Ninja Cookie the short version is just 0.7, so perhaps that the confusion.

luispuerto avatar May 18 '21 17:05 luispuerto

Yep, I get the same, even immediately after installing the app.

↪️ mas search "ninja cookie"
  1535219336  Ninja Cookie (0.7.1)

↪️  mas info 1535219336   
Ninja Cookie 0.7.1 [0.0]
By: Theo GOUDOUT
Released: 2021-05-14
Minimum OS: 10.14
Size: 4 MB
From: https://apps.apple.com/us/app/ninja-cookie/id1535219336?mt=12&uo=4

↪️  mas purchase 1535219336
==> Downloading Ninja Cookie
==> Installed Ninja Cookie

↪️  mas outdated
1535219336 Ninja Cookie (0.7 -> 0.7.1)

phatblat avatar May 20 '21 04:05 phatblat

Sorry. There have been a handful of annoying issues like this since we fixed the outdated and upgrade commands.

Noticed that both the version numbers in the outdated output are listed in the app's "About" window and Info.plist file.

Screen Shot 2021-05-19 at 10 46 38 PM
<key>CFBundleShortVersionString</key>
<string>0.7</string>
<key>CFBundleVersion</key>
<string>0.7.1</string>

phatblat avatar May 20 '21 05:05 phatblat

Great that you can reproduce @phatblat. I think that the issue can have two fold fixes…

  1. Have a way that you can ask mas ignore an update of an app. Like pin in brew. Of course it could still be updated on the app store if there is a real update, but if would be nice to ignore app updated on the mas.
  2. Fix the correct reading of the version.

luispuerto avatar May 20 '21 07:05 luispuerto

I recently fixed the case where the bundle version is newer than the App Store version. This is the opposite case. We don't have a way to get the bundle version from the App Store without downloading the app again every time we want to check for the latest release.

We could heuristically parse both CFBundleShortVersionString and CFBundleVersion, and if they're both parseable as Semantic Versions, use the greater of the two as the "installed" version to be compared against the App Store version. It'll catch cases like this one, but there are probably still more edge and corner cases.

chris-araman avatar Jun 03 '21 21:06 chris-araman

I'm still seeing this myself with 1Blocker 3.16.2

brzzdev avatar Jul 27 '21 21:07 brzzdev

We could heuristically parse both CFBundleShortVersionString and CFBundleVersion, and if they're both parseable as Semantic Versions, use the greater of the two as the "installed" version to be compared against the App Store version.

It seems this plan isn't going to work, as CFBundleVersion seems to have no relation to CFBundleShortVersionString for many apps.

As things are today, using only CKSoftwareProduct.bundleVersion, which is generally expected to match CFBundleShortVersionString:

1489275350  Crossy Castle             (5.1)
1480068668  Messenger                 (97.11.116)
640199958   Developer                 (9.2.2)
1376509945  Populus Run               (1.3)
409183694   Keynote                   (11.1)
784801555   Microsoft OneNote         (16.51)
823766827   OneDrive                  (21.129.0627)
462058435   Microsoft Excel           (16.51)
1142578753  OmniGraffle               (7.18.5)
1482454543  Twitter                   (8.75)
1462114288  Grammarly for Safari      (9.36)
1496833156  Playgrounds               (3.4.1)
682658836   GarageBand                (10.4.3)
462062816   Microsoft PowerPoint      (16.51)
1206020918  Battery Indicator         (2.9.1)
1289197285  MindNode                  (2021.2.2)
1153157709  Speedtest                 (1.20)
409203825   Numbers                   (11.1)
497799835   Xcode                     (12.5.1)
1464883939  Frogger in Toy Town       (1.5.2)
409201541   Pages                     (11.1)
1448916662  Step Two                  (3.1.1)
1475387142  Tailscale                 (1.10.1)
408981434   iMovie                    (10.2.5)
985367838   Microsoft Outlook         (16.51)
1295203466  Microsoft Remote Desktop  (10.6.7)
1450874784  Transporter               (1.2.2)
803453959   Slack                     (4.18.0)
1470584107  Dato                      (3.0.1)
462054704   Microsoft Word            (16.51)
1263070803  Lungo                     (1.9.0)

However, using the greater of CKSoftwareProduct.bundleVersion, CFBundleShortVersionString, and CFBundleVersion, we see that CFBundleVersion is frequently unrelated to the former two:

1489275350  Crossy Castle             (7740.0.0)
1480068668  Messenger                 (283133794.0.0)
640199958   Developer                 (922.3.2)
1376509945  Populus Run               (210630606.0.0)
409183694   Keynote                   (7031.0.102)
784801555   Microsoft OneNote         (16.51.21071101)
823766827   OneDrive                  (21129.627.2)
462058435   Microsoft Excel           (16.51.21071101)
1142578753  OmniGraffle               (204.16.0)
1482454543  Twitter                   (8.75.0)
1462114288  Grammarly for Safari      (16.0.302203)
1496833156  Playgrounds               (1302.34.0)
682658836   GarageBand                (5433.0.0)
462062816   Microsoft PowerPoint      (16.51.21071101)
1206020918  Battery Indicator         (33.0.0)
1289197285  MindNode                  (2021.2.2)
1153157709  Speedtest                 (1.20.4)
409203825   Numbers                   (7031.0.102)
497799835   Xcode                     (18212.0.0)
1464883939  Frogger in Toy Town       (341.0.0)
409201541   Pages                     (7031.0.102)
1448916662  Step Two                  (23.0.0)
1475387142  Tailscale                 (101.10.1)
408981434   iMovie                    (400096.0.0)
985367838   Microsoft Outlook         (16.51.21071101)
1295203466  Microsoft Remote Desktop  (1896.0.0)
1450874784  Transporter               (1256.0.0)
803453959   Slack                     (6748.0.0)
1470584107  Dato                      (58.0.0)
462054704   Microsoft Word            (16.51.21071101)
1263070803  Lungo                     (18.0.0)

Unfortunately, more reports of the problem aren't helping us reach a solution. We understand the cause of the problem, but we need a viable proposal for how to address it in order to move forward.

Perhaps there's some investigation to be done into the private CommerceKit and StoreFoundation that might shed some light on this sort of versioning discrepancy? Maybe some magic to CKSoftwareProduct.versionIdentifier, expectedBundleVersion, or expectedStoreVersion? 🤷🏻‍♂️✨

chris-araman avatar Jul 28 '21 04:07 chris-araman

I have the same issues with:

1515959873 Theu2007Survivalists (1.0.747221 -> 1.4)
1513822917 Baldo The Guardian Owls (1.1.1 -> 1.1.4)
1538650027 Alto's Odyssey The Lost City (1.1.1 -> 1.1.2)

Running e.g. mas info 1538650027 shows the latest version as 1.1.2, but the English as well as the German App Store pages show the latest version as 1.1.1.

melgu avatar Sep 04 '21 13:09 melgu

I get a current version of 1Blocker reported as outdated: 1365531024 1Blocker (4.1 -> 5.1)

I would like to highlight this, as I didn't see this mentioned yet: On the German Mac App Store, 4.1 is the current version of 1Blocker, but 5.1 is the current version of 1Blocker in the iOS store.

I'm on 12.0.1 on Apple Silicon, so also some apps from the iOS store are installable, but not 1Blocker. mas reports version 1.8.5.

aumuell avatar Nov 17 '21 12:11 aumuell

I've summarized this in the Known Issues section of the README.

Additional reports of apps with mismatched app bundle versions are unfortunately not helpful at this point. Pull requests are welcome!

chris-araman avatar Nov 18 '21 19:11 chris-araman

Out of interest (and yes I have my own persistent list of apps that are always getting updated), I also use CleanMy Mac and it's updater list generally has the correct versions for the same two apps, could be worth asking them how they get updated version lists?

ChrisChinchilla avatar Jan 16 '22 12:01 ChrisChinchilla

I had this issue with Zentuner, where it would upgrade every time

$ mas outdated
1550640624 ZenTuner (0.2.0 -> 0.2.2)

The workaround was to edit /Applications/ZenTuner.app/Contents/Info.plist

...
  <key>CFBundleShortVersionString</key>
  <string>0.2.0</string>
...

and and the value to 0.2.2. This isn't recommended, but useful if you have mas upgrade running on schedule and don't want to reinstall certain applications every time

TheDen avatar Jul 21 '22 04:07 TheDen

See Feature Request https://github.com/mas-cli/mas/issues/468

$ mas outdated 1550640624 ZenTuner (0.2.0 -> 0.2.2)

$ mas-versions 1550640624 { "platform": "osx", "version": "0.2.0" } { "platform": "ios", "version": "0.2.2" }

nicerloop avatar Oct 19 '22 12:10 nicerloop