Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to update WhatsApp Messenger #722

Open
JayaswalPrateek opened this issue Feb 4, 2025 · 11 comments
Open

unable to update WhatsApp Messenger #722

JayaswalPrateek opened this issue Feb 4, 2025 · 11 comments
Labels

Comments

@JayaswalPrateek
Copy link

mas config

mas ▁▁▁▁ 1.9.0
arch ▁▁▁ arm64
from ▁▁▁ homebrew/core/mas
origin ▁ https://github.com/mas-cli/mas.git
rev ▁▁▁▁ a5a928a2e6a28a5c751bca7f63f26b06cede8197
driver ▁ 1.115
swift ▁▁ 6.0.2 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)
region ▁ IN
macos ▁▁ 15.3 (24D60)
mac ▁▁▁▁ Mac14,2
cpu ▁▁▁▁ Apple M2

mas version (output of mas version)

1.9.0

macOS version (output of sw_vers -productVersion)

15.3

macOS build (output of sw_vers -buildVersion)

24D60

CPU (output of sysctl -n machdep.cpu.brand_string)

Apple M2

Installation method

Homebrew core (via brew install mas)

Bug description

Every time I run mas upgrade, it detects WhatsApp Messenger as outdated(25.1.10) and tries to update it to 25.1.83. Even after a successful update, it still finds it outdated in the next run. While the app itself never updates to 25.1.83 and stays on Version 25.1.10 (688756559), yet it detects it as outdated upon every single run and still tries to update it to 25.1.83 and tells it happened successful even though it didn't. It keeps installing the older version again and again on every run.

prateek@Prateeks-MacBook ~> mas list | grep WhatsApp
310633997   ‎WhatsApp                         (25.1.10)

prateek@Prateeks-MacBook ~> mas upgrade
Upgrading 1 outdated application:
WhatsApp Messenger (25.1.10) -> (25.1.83)
==> Downloaded WhatsApp Messenger (25.1.10)
==> Installing WhatsApp Messenger (25.1.10)
==> Installed WhatsApp Messenger (25.1.10)

prateek@Prateeks-MacBook ~> mas list | grep WhatsApp
310633997   ‎WhatsApp                         (25.1.10)

prateek@Prateeks-MacBook ~> mas upgrade
Upgrading 1 outdated application:
WhatsApp Messenger (25.1.10) -> (25.1.83)
==> Downloaded WhatsApp Messenger (25.1.10)
==> Installing WhatsApp Messenger (25.1.10)
==> Installed WhatsApp Messenger (25.1.10)

prateek@Prateeks-MacBook ~> mas list | grep WhatsApp
310633997   ‎WhatsApp                         (25.1.10)

Steps to reproduce

$ mas list | grep WhatsApp
$ mas upgrade
$ mas list | grep WhatsApp
$ mas upgrade
$ mas list | grep WhatsApp
@rgoldberg
Copy link
Contributor

@JayaswalPrateek Thanks for the bug report.

The Apple private framework that mas uses to install & to upgrade apps is somehow choosing to install a version that isn't the latest.

I don't know why that is. There are multiple ways in which the Apple code used can be configured, but none of it is documented.

I might not be able to fix this for a while, so if anyone else wants to investigate, the relevant code is in SSPurchase.swift. The entry point for mas upgrade is MAS.Upgrade.run() in Upgrade.swift, which makes calls that eventually call the functions in SSPurchase.swift.

You need to build using script/build to generate a file necessary for the build to work. Otherwise, if you just build in Xcode, you'll get errors.

@JayaswalPrateek
Copy link
Author

Thanks for the response @rgoldberg!
Based on your previous experience with this framework, do you think there could be any dirty way to fix this issue? Like reinstalling that app or mas itself or maybe signing out from Mac app store and then signing back in? Any index/version files that can be deleted/regenerated?

@rgoldberg
Copy link
Contributor

@JayaswalPrateek Unfortunately, besides updating the app directly using the App Store GUI application from Apple (instead of using mas), I do not know other solutions.

The integration with the relevant frameworks was done by someone else a long time ago.

I've looked into a few properties of SSPurchase before for other issues, but the variations of values that I tried didn't seem to have any effect for those issues, IIRC.

I have various notes about some info I've seen online & about my experiments, but I won't be able to find/collate them anytime soon.

There might be newer, better frameworks for mas to use, but I won't be able to look at them soon, either.

Sorry for the unsatisfactory answers.

I wish that I or someone else could look into it all right now.

@moenodedev
Copy link

moenodedev commented Feb 6, 2025

Is it related to Homebrew/homebrew-bundle#1569?

$ mas list | grep WhatsApp
310633997   WhatsApp   (25.1.10)
$ mas list | grep WhatsApp | cat -v
310633997   �M-^@M-^NWhatsApp   (25.1.10)

@luciodaou
Copy link

I noticed the same issue.

It also happens with other apps, as shown by "Latest" app:
Image

Even if I remove WhatsApp and reinstall it from the AppStore, it still downloads 25.1.10 version:
Image

What I found weird is that I'm finding news regarding the launch of 25.1.83 version for MacOS, the AppStore even have a changelog, that weirdly doesn't show 25.1.10:
Image

@rgoldberg
Copy link
Contributor

@JayaswalPrateek @moenodedev @luciodaou Thanks for the info.

Are any of you able to install WhatsApp 25.1.83 directly from the App Store GUI?

Does the same problem occur when trying to upgrade GRIS+, either via mas or via the App Store GUI?

(I'm away from my computer, so can't test now)

@JayaswalPrateek
Copy link
Author

Yes, removing it and reinstalling it from the App Store installs the latest version and the subsequent mas upgrade will downgrade it from 25.1.83 to 25.1.10

I would like to propose a temporary workaround by adding a --ignore subcommand to specify such packages which will be ignored during mas upgrade. This will ensure other packages can be swiftly upgraded.

@luciodaou
Copy link

@JayaswalPrateek @moenodedev @luciodaou Thanks for the info.

Are any of you able to install WhatsApp 25.1.83 directly from the App Store GUI?

Does the same problem occur when trying to upgrade GRIS+, either via mas or via the App Store GUI?

(I'm away from my computer, so can't test now)

I can't. That's exactly what I tried to do using the app store, after removing and reinstall, it installed 25.1.10.

Yes, same thing with GRIS+.

The appstore doesn't offer me an update option for either app.

I'm starting to believe this is related to the app store more than with mas.

@rgoldberg
Copy link
Contributor

@JayaswalPrateek @luciodaou mas upgrade 310633997 upgraded me to 25.1.10. I could not use mas to upgrade to a newer version.

mas info 310633997 & the US App Store showed that 25.1.83 was available, but the App Store only showed "Open" instead of "Update".

I uninstalled WhatsApp 25.1.10 using Finder. I downloaded WhatsApp from the US App Store, but it also installed 25.1.10, not 25.1.83.

@luciodaou Was that your experience, too?

@JayaswalPrateek It sounds like: after uninstalling WhatsApp 25.1.10 (did you use mas, Finder, something else?), you downloaded WhatsApp from the IN App Store, and it installed 25.1.83. If that is correct, how did you verify the version? Did you open WhatsApp, then open the About dialog via the menu --> WhatsApp -> About WhatsApp? If so, I don't know why things behaved differently for you than for me (& possibly for @luciodaou).

@luciodaou
Copy link

@JayaswalPrateek @luciodaou mas upgrade 310633997 upgraded me to 25.1.10. I could not use mas to upgrade to a newer version.

mas info 310633997 & the US App Store showed that 25.1.83 was available, but the App Store only showed "Open" instead of "Update".

I uninstalled WhatsApp 25.1.10 using Finder. I downloaded WhatsApp from the US App Store, but it also installed 25.1.10, not 25.1.83.

@luciodaou Was that your experience, too?

Exactly that! I uninstalled Whatsapp through the Launchpad (iPad like screen). And my AppStore is the Brazilian one.

@JayaswalPrateek
Copy link
Author

JayaswalPrateek commented Feb 7, 2025

@rgoldberg Few days back, I did try uninstalling 25.1.10 and was able to reinstall it as 25.1.83(as seen in Menu -> WhatsApp -> About WhatsApp) from IN App Store. I tried it again today, and I am no longer able to download 25.1.83 from the IN App Store even though it's marked as the latest release(25.1.10 was downloaded instead). And the 'Open' button is not marked as 'Update' on the IN App Store page for WhatsApp either.

This seems like an App Store quirk where the latest release is bumped up in the metadata/release notes without the download being made available, which causes mas to redownload the previous version(that's most likely already installed) all over again.

My current gripe is that everytime I run mas upgrade regardless of the fact if there are other updates available, WhatsApp is always redownloaded, which causes significant bandwidth wastage as it's a pretty large app. Is there a way for mas to avoid this? Either by having a --ignore flag which won't upgrade certain specified packages, or by detecting that while trying to update 25.1.10 to 25.1.83 its downloading 25.1.10 again so it should simply skip that download instead as its already downloaded. Such events aren't errors per se, and instead can be displayed as a WARNING that the new release isn't available in your region, try again later.

So instead of this:

prateek@Prateeks-MacBook ~> mas upgrade
Upgrading 1 outdated application:
WhatsApp Messenger (25.1.10) -> (25.1.83)
==> Downloaded WhatsApp Messenger (25.1.10)
==> Installing WhatsApp Messenger (25.1.10)
==> Installed WhatsApp Messenger (25.1.10)

we could have something like:

prateek@Prateeks-MacBook ~> mas upgrade
Upgrading 1 outdated application:
WhatsApp Messenger (25.1.10) -> (25.1.83)
WARNING: Skipping it, version 25.1.83 not available in your region

or
mas upgrade --ignore "Whatsapp"
mas upgrade --ignore 310633997

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants