mas-cli / mas

:package: Mac App Store command line interface
MIT License
10.93k stars 275 forks source link

`list` sometimes doesn't see apps until after reboot or `outdated` or `info` has been run #458

Open dalisoft opened 2 years ago

dalisoft commented 2 years ago

Your Environment

mas Install Method

Describe the Bug

Apps in App Store are not in sync with mas

To Reproduce

Steps to reproduce the behavior:

  1. Go to App Store
  2. Download any your apps from App Store
  3. Run mas list
  4. See out of sync of apps

Expected Behavior

App in list of mas list

Actual Behavior

App does not include in list

Screenshots, Terminal Output

If applicable, add screenshots to help explain your problem.

$ mas command
...

Additional Context

Requires reboot system to properly returning result

cpick commented 1 year ago

I ran into this same issue.

I ran mas list and noticed an ID for a manually-installed App was missing (eg: 123456). I then ran mas info 123456 after which it started appearing in subsequent mas list runs (without a reboot).

StefanLobbenmeier commented 1 year ago

Requires reboot system to properly returning result

Could you check next time, if mas outdated fixes it for you instead of reboot?

dalisoft commented 1 year ago

@StefanLobbenmeier Yes, today tested it again, it works, but not properly as excepted. Some apps shows other versions rather than latest App Store

rgoldberg commented 3 weeks ago

Running mas list right after installing an app from the Mac App Store didn't include the new app in the output.

Waiting a minute, then running mas list again included the newly installed app.

mas obtains the list of installed apps from an Apple data structure that is eventually updated, but not updated right away.

We could try to obtain installed app info from Spotlight, instead, but Spotlight doesn't include the exact app name, Spotlight probably doesn't update any faster than the data structure that we already use, and why reinvent the wheel to fix something that waiting a minute or running another innocuous command can easily fix?

StefanLobbenmeier commented 3 weeks ago

That’s good to know. Does mas outdated do anything special that refreshes that file?

rgoldberg commented 3 weeks ago

@StefanLobbenmeier outdated & list both iterate once through that data structure. They don't interact with it in any other way, nor do they interact with anything else that should influence the data structure.

info doesn't access that data structure, nor does it even access anything from the same framework.

I assume that running anything that touches the data structure is as likely as anything else (except a logout then login, restart, or power cycle) to trigger an eventual refresh, if any such interactions trigger a refresh at all. Maybe there's a refresh command, but I don't know about one.

Either way, I think the current "solutions" of running other mas commands really just allow additional time to elapse, thus allowing an already scheduled / currently running refresh to finish.