Skip to content

Refresh the Xcode list on launch, sign-in and data source change - #863

Draft
anciltech wants to merge 3 commits into
XcodesOrg:mainfrom
anciltech:fix/auto-refresh
Draft

anciltech wants to merge 3 commits into
XcodesOrg:mainfrom
anciltech:fix/auto-refresh

Conversation

@anciltech

Copy link
Copy Markdown

Summary

The available Xcode list was only fetched when the cache was more than 5 hours old. New releases (e.g. a new beta) didn't appear until a manual refresh, and switching the data source kept showing the previous source's cached list.

  • Always fetch once per launch, regardless of cache age.
  • Refresh after signing in; with the Apple data source, restart a refresh that started without a session.
  • Refresh immediately when the data source changes in Settings.
  • Becoming active no longer cancels a running full refresh (it previously did, via updateTask?.cancel() in updateIfNeeded). It still replaces a quick installed-only rescan, as before.
  • Errors from a refresh that was cancelled to be restarted are ignored (URLSession can surface cancellation as URLError.cancelled).
  • Switching the data source no longer posts "New Xcode version available": the two sources identify releases differently, so the immediate refresh made every release look new.

update() gains restartingInFlightUpdate:; the toolbar's Refresh button now wraps the call in a closure.

Tests

  • test_UpdateIfNeeded_FirstCallThisLaunch_RefreshesEvenWithFreshCache (also checks re-activation doesn't cancel it)
  • test_Update_OnlyRestartsRunningFullRefreshWhenAsked
  • test_UpdateIfNeeded_OldTaskDoesNotClearReplacementTask now marks the launch refresh as done, since it tests the installed-only path.

🤖 Generated with Claude Code

anciltech and others added 3 commits September 29, 2026 08:05
The available list was only fetched when the cache was over 5 hours
old, so new releases didn't appear until a manual refresh, and switching
the data source kept showing the previous source's cached list.

- Always fetch once per launch, regardless of cache age.
- Refresh after signing in; with the Apple data source, restart a
  refresh that started without a session.
- Refresh immediately when the data source changes.
- Becoming active no longer cancels a running full refresh (it still
  replaces a quick installed-only rescan).
- Ignore errors from a refresh that was cancelled to be restarted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Apple and Xcode Releases sources identify releases differently, so
the refresh that now runs right after switching made every release look
new and posted a "New Xcode version available" notification.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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.

1 participant