fix(app): reuse cached releases on launch and product switch#516
Merged
Conversation
refresh() always called dataProvider.clearCache() — which also wipes the process-wide URLCache — before fetching, and it was the only load path: the initial .task, switchProduct, the toolbar button, and the alert retry all routed through it. So every launch re-downloaded all ~280/~130 release files (defeating URLCache's stale-while-revalidate disk cache), and toggling macOS↔Xcode re-fetched the whole catalog each time even though DataProvider's cache is product-keyed precisely so both can coexist. Split a cache-honoring load() (used by the initial .task and switchProduct) from refresh() (clearCache + load, kept for the explicit ⌘R command and the retry button). Product switches and warm launches now serve from cache. Signed-off-by: Patrick Linnane <patrick@linnane.io> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
refresh()always calleddataProvider.clearCache()— which also clears the process-wideURLCache— before fetching, and it was the only load path: the initial.task,switchProduct, the toolbar button, and the alert retry all routed through it. So every launch re-downloaded all ~280/~130 release files (defeating the API'sstale-while-revalidatedisk cache), and toggling macOS↔Xcode re-fetched the entire catalog each time even thoughDataProvider's cache is product-keyed specifically so both products can coexist.This splits a cache-honoring
load()(used by the initial.taskandswitchProduct) fromrefresh()(clearCache+load, kept for the explicit ⌘R command and the retry button). Product switches and warm launches now serve from cache; ⌘R still forces a fresh fetch. Built the app target to confirm it compiles. (The orphaned-Task race inswitchProductis a separate finding and not addressed here.)