fix(ios): reuse already-downloaded GitHub vault + Clear GitHub cache#162
Merged
Conversation
b6157a1 to
42db00c
Compare
…b cache" Two GitHub-vault tidies: - Dedupe re-open: opening a repo that's already materialized now opens the local copy instantly instead of re-downloading the whole zipball (Refresh pulls the latest). Mirrors the desktop, which already reuses a cached vault. Guarded so the refresh fallback (which must re-download) is unaffected. - Clear GitHub cache: downloaded vaults accumulate under Application Support with no way to reclaim space. Settings now shows the total size and a "Clear GitHub cache" action that removes every downloaded vault except the open one, plus the transient asset cache, then prunes dead switcher entries. Size/clear run off the main actor. GitHubService gains nonisolated downloadedVaults() / clearCaches(keeping:) / directorySize(); VaultStore.forgetMissingVaults(). EN + 中文 strings. app simulator build ✓. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
42db00c to
7b687da
Compare
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.
Item 4/4 — the iOS gaps (the desktop already reuses a cached vault).
Dedupe re-open
Opening a repo that's already materialized now opens the local copy instantly instead of re-downloading the whole zipball — "Refresh from GitHub" is how you pull the latest. Mirrors the desktop's cached-vault behaviour. Guarded so the refresh full-reset fallback (which must re-download) is unaffected.
Clear GitHub cache
Downloaded vaults accumulate under Application Support with no way to reclaim space. Settings now shows the total size and a "Clear GitHub cache" action that removes every downloaded vault except the open one, plus the transient asset cache, then prunes dead vault-switcher entries. Size computation + clearing run off the main actor.
GitHubService:downloadedVaults()/clearCaches(keeping:)/directorySize()(allnonisolated).VaultStore.forgetMissingVaults().Verify
App simulator build ✓.
This completes the 4-item GitHub-vault UX pass (data-loss guards ×2, visual distinction ×2, dedupe + cache).
🤖 Generated with Claude Code