Skip to content

Improve cached startup state and keep directory scans responsive#1

Open
moreaki wants to merge 3 commits intofix/combined-directory-monitoringfrom
feature/nonblocking-directory-scan-ui
Open

Improve cached startup state and keep directory scans responsive#1
moreaki wants to merge 3 commits intofix/combined-directory-monitoringfrom
feature/nonblocking-directory-scan-ui

Conversation

@moreaki
Copy link
Copy Markdown
Owner

@moreaki moreaki commented Mar 15, 2026

Summary

On top of fix/combined-directory-monitoring, this branch turns the app into a much better "show something immediately, finish work in the background" experience, and adds guardrails for the slow-path cases.

The main user-facing changes are:

  • Latest restores the last known app list on launch from cache in AppDataStore, instead of starting with an empty main window every time.
  • Cached update availability is restored too, via Update, App, and UpdateButton, but stale cached updates are treated as non-actionable until a fresh check confirms them.
  • Snapshot generation for the main table was moved off the main thread and coalesced in UpdateTableViewController, UpdateTableView+Search, and AppListSnapshot, so large refreshes no longer block the UI while snapshots are rebuilt.
  • The Settings locations list no longer repeatedly rescans the same directory count on every redraw; AppDirectoryCellView now uses a shared cached/deduplicated count provider.
  • Adding a very broad scan root like /, the home folder, or a whole volume now triggers a warning in AppLocationViewController, so users are nudged toward choosing a narrower app folder instead of accidentally selecting an entire disk.

Under the hood, scan performance and scan behavior were tightened:

  • BundleCollector now enumerates candidate .app bundles first and processes them concurrently for larger result sets.
  • Source detection no longer needlessly reopens bundles, via BundleCollector, MacAppStoreCheckerOperation, SparkleCheckerOperation, and UpdateCheckCoordinator.
  • AppDirectory now performs collection work on a utility queue instead of doing that work inline on a generic serial queue with a misleading name.

The branch also includes diagnostics and failure UX that fit naturally on top of the combined monitoring base branch:

  • Observation failures are buffered until a delegate exists in UpdateCheckCoordinator, so startup failures are not dropped.
  • Opt-in diagnostics tracing lives in Observable, disabled by default, so we can later build richer app-aware tracing on top of it.
  • Real observation/access failures are shown through the polished custom sheet in MainWindowController, and the same component is reused from Settings when a location count hits the same failure mode.
  • Strings for the broad-folder warning and permission/access guidance were added in Localizable.strings.

So the PR story is basically:

  • base branch fix/combined-directory-monitoring fixes correctness: no startup crash, recursive monitoring, visible access-failure handling
  • this branch improves responsiveness and usability on top of that: cached startup state, nonblocking UI refresh, faster/more efficient scanning, smarter Settings behavior, and retained diagnostics support

Verification

  • xcodebuild -project Latest.xcodeproj -scheme Latest -configuration Debug CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= build

I did not run the full test suite end-to-end because the existing test-target dependency issue with CommerceKit / StoreFoundation still applies.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant