Skip to content

Improve app version comparison #447

@eatstorming

Description

@eatstorming

I just started using MAS yesterday and I ran into a weird issue. One of the apps I use (Spark Mail) recently had an update where the version number has a space, seemingly by mistake: 2. 11.9

This seems to throw off MAS every time I run mas upgrade:

   ~  mas outdated
1176895641 Spark (2.11.9 -> 2. 11.9)
   ~  mas upgrade
Upgrading 1 outdated application:
Spark (2.11.9)
==> Downloading Spark – Email App by Readdle
==> Installed Spark – Email App by Readdle 
   ~  mas upgrade
Upgrading 1 outdated application:
Spark (2.11.9)
==> Downloading Spark – Email App by Readdle
==> Installed Spark – Email App by Readdle
   ~  mas outdated
1176895641 Spark (2.11.9 -> 2. 11.9)
   ~ 

So my guess is that the space in the version is throwing the check off.

I tried to check the code, and got as far as seeing that isOutdatedWhenComparedTo uses Version to compare store version to the installed version, but after that I was unable to check if Version has any parameters that allow it to strip off spaces from the string being passed to it. I'm also not sure if deliberately changing bundleVersion to do this could have unexpected issues down the line.

Lastly, I'm also aware that in this case it's likely that the issue will fix itself once a new update to the app comes out, hopefully without the "typo" in the version number, but I'm wondering if this is something MAS should handle better. The App Store GUI does not have the same issue, as checking for updates does not find anything new for Spark (and I've had a few other apps updated since the latest Spark one).

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions