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

Some apps display a blank name in outdated & their bundleId in list output #490

Closed
1 task done
carlosfrodriguez opened this issue Apr 18, 2023 · 8 comments · Fixed by #690
Closed
1 task done

Some apps display a blank name in outdated & their bundleId in list output #490

carlosfrodriguez opened this issue Apr 18, 2023 · 8 comments · Fixed by #690
Assignees
Milestone

Comments

@carlosfrodriguez
Copy link

carlosfrodriguez commented Apr 18, 2023

Solution?

Replace appNameOrBundleIdentifier with displayName, and probably replace appName wherever it is used to output.

displayName would output the fir non-empty value of the following:

  • appName
  • The basename without the .app extension of the bundlePath
    • Can be slightly different than the app name from the MAS.
    • Does not require a network call.
  • bundleIdentifier

Rejected looking up the trackName from a storeSearch.lookup(app: appId) call:

  • Despite providing the most accurate app name.
  • Requires a network call.
  • Requires an AppStoreSearcher to be passed around / made available.
  • Can always add this in later if the problem is frequent, but doubt that it would be frequent.

Original Issue

Your Environment

  • mas version:1.8.6
  • macOS version (system_profiler SPSoftwareDataType -detailLevel mini): 13.3.1

mas Install Method

  • brew install mas (homebrew-core)
  • [] mas-cli/tap
  • [] .pkg installer 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:

  1. Download the app from the official app store
  2. Execute mas list
  3. 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?

@rgoldberg
Copy link
Contributor

rgoldberg commented Sep 5, 2024

@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 *.app directory from bundlePath / from kMDItemDisplayName if we switch to Spotlight (obtainable via this regex (?<=/)[^/]+(?=\.app$))
  • the trackName from a storeSearch.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?

@rgoldberg rgoldberg changed the title 🐛 [BUG] 🐛 [BUG] Some apps display a blank name in outdated & their bundleId in list output Sep 5, 2024
@rgoldberg rgoldberg changed the title 🐛 [BUG] Some apps display a blank name in outdated & their bundleId in list output Some apps display a blank name in outdated & their bundleId in list output Sep 14, 2024
@rgoldberg
Copy link
Contributor

@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.

@rgoldberg
Copy link
Contributor

@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.

@rgoldberg
Copy link
Contributor

@carlosfrodriguez Does mas 1.8.7 fix this issue?

@carlosfrodriguez
Copy link
Author

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

@rgoldberg
Copy link
Contributor

rgoldberg commented Dec 2, 2024

@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.

@rgoldberg
Copy link
Contributor

Reopening because we should replace appNameOrBundleIdentifier with displayName as per #490 (comment).

@rgoldberg
Copy link
Contributor

Resolved by #690.

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

Successfully merging a pull request may close this issue.

2 participants