Skip to content

Fix installed and active state not refreshing after install, select, and uninstall. - #886

Open
jrlanglois wants to merge 1 commit into
XcodesOrg:mainfrom
jrlanglois:jrlanglois/stateRefreshFix
Open

jrlanglois wants to merge 1 commit into
XcodesOrg:mainfrom
jrlanglois:jrlanglois/stateRefreshFix

Conversation

@jrlanglois

@jrlanglois jrlanglois commented Nov 2, 2026 •

Copy link
Copy Markdown

Note

Fixes #836.

Problem

The Xcode list is rebuilt from a cached list of installed Xcodes whenever the active Xcode or the available list changes.

Three actions didn't keep that cache up to date:

  • "Install" updated its own row but not the cache, so making the new Xcode active afterwards showed it as not installed, and nothing showed as active.
  • "Make Active" didn't rescan either, so after the "rename to Xcode.app" option moved bundles, the list still pointed at the old paths.
  • "Uninstall" rescanned only after the list was rebuilt, so the removed Xcode briefly showed as installed again.

Solution

All three now rescan the install directory first, so the list matches what's on disk.

Two new tests in AppStateTests:

  • one makes a newly installed Xcode active and checks it shows as installed and active
  • the other checks that uninstall never shows the removed Xcode as installed again.

Both fail without this change.

xcodebuild test -scheme Xcodes (the CI command) passes on Xcode 27.2: 53 tests, 0 failures.

…and uninstall

Problem

The Xcode list is rebuilt from a cached list of installed Xcodes whenever the active Xcode or the available list changes.

Three actions didn't keep that cache up to date:

* "Install" updated its own row but not the cache, so making the new Xcode active afterwards showed it as not installed, and nothing showed as active.
* "Make Active" didn't rescan either, so after the "rename to Xcode.app" option moved bundles, the list still pointed at the old paths.
* "Uninstall" rescanned only after the list was rebuilt, so the removed Xcode briefly showed as installed again.

Fixes XcodesOrg#836.

Solution

All three now rescan the install directory first, so the list matches what's on disk.

Two new tests in `AppStateTests`: one makes a newly installed Xcode active and checks it shows as installed and active; the other checks that uninstall never shows the removed Xcode as installed again. Both fail without this change. `xcodebuild test -scheme Xcodes` (the CI command) passes on Xcode 27.2: 53 tests, 0 failures.

This branch has not been deployed

No deployments
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.

Xcodes installs latest Xcode then shows it as not installed

1 participant