Some apps display a blank name in `outdated` & their bundleId in `list` output
Your Environment
-
mas version:1.8.6 - macOS version (
system_profiler SPSoftwareDataType -detailLevel mini): 13.3.1
mas Install Method
- [X]
brew install mas(homebrew-core) - [] mas-cli/tap
- []
.pkginstaller from releases - [] Built from source
- Fork/branch: ? (e.g. mas-cli/main)
- Xcode version: 10.?
Describe the Bug
Bandwidth+ App name does not show correctly or even does not show, depends on the command.
App link https://apps.apple.com/es/app/bandwidth/id490461369?l=en&mt=12
To Reproduce
Steps to reproduce the behavior:
- Download the app from the official app store
- Execute
mas list - Execute
mas outdated
Expected Behaviour
The name of the App (Bandwidth+) is displayed correctly and consistent among the mas commands
Actual Behaviour
- For the list command it shows as au.id.haroldchu.mac.Bandwidth
- For the outdated command it shows no name
Screenshots, Terminal Output
$ mas list
1219074514 Vectornator (4.13.3)
409183694 Keynote (13.0)
1541482816 PSWD (3.2)
1278508951 Trello (2.13.10)
1185488696 Money (7.0.25)
439654198 SimpleMind (2.0.2)
490461369 au.id.haroldchu.mac.Bandwidth (1.21)
$ mas outdated
490461369 (1.21 -> 1.22)
439654198 SimpleMind (2.0.2 -> 2.1.0)
1219074514 Vectornator (4.13.3 -> 4.13.4)
1185488696 Money (7.0.25 -> 7.0.26)
Additional Context
Add any other context about the problem here. Did it work in a previous version?
@phatblat @chris-araman I didn't want to install a random app on my computer, but I'm assuming that somehow the appName for this app is empty.
It looks like installed SoftwareProducts are provided by CKSoftwareMap.shared(). That's undocumented/unsupported Apple code, right?
If so, I assume that the empty appName isn't mas's fault, right? (unless mas can somehow configure CKSoftwareMap.shared() better)
If that is correct, I propose:
Getting rid of appNameOrBundleIdentifier.
Using a new displayName wherever appNameOrBundleIdentifier was previously used, and probably everywhere (or most places) appName was used.
displayName would output any non-empty appName, while for empty appNames, we can decide to have it output either:
- the basename of the
*.appdirectory frombundlePath/ fromkMDItemDisplayNameif we switch to Spotlight (obtainable via this regex(?<=/)[^/]+(?=\.app$)) - the
trackNamefrom astoreSearch.lookup(app: appId)
The first option relies on the *.app name from the file system, while the second option requires contacting the MAS servers an extra time, but would probably provide a more accurate fallback app name.
Which do you prefer?
@carlosfrodriguez Can you help us diagnose this issue?
Is this still occurring with the "stable" mas 1.8.6 release?
If so, can you try installing the much improved unreleased version of mas from the main branch via Homebrew via:
brew install --HEAD mas
Does that still experience this issue?
Thanks.
@carlosfrodriguez I installed Bandwidth+.
For both 1.8.6 & the new code in the main branch, mas list output:
490461369 Bandwidth+ (1.27)
Maybe this was a problem with Bandwidth+ 1.21. Maybe it was a transient error.
@carlosfrodriguez Does mas 1.8.7 fix this issue?
Hi @rgoldberg I'm not able to reproduce it entirely as Bandwidth+ is currently updated, but I can see from the list command that it shows the name correctly now, so I trust if you say that is fixed now
@carlosfrodriguez I don't know for sure that it's fixed by anything in the mas code, I just haven't experienced the issue in 1.8.7. It might have been caused by bad data for Bandwidth+ in the Mac App Store that has subsequently been fixed.
If you or anyone else experiences a similar problem, then I assume you or they will open a new issue, at which time we can investigate when we can reproduce the error.
Thanks for the info.
Reopening because we should replace appNameOrBundleIdentifier with displayName as per https://github.com/mas-cli/mas/issues/490#issuecomment-2331114385.
Resolved by #690.