Repository navigation
fix: preserve installed bundles during disk cleanup - #64
Merged
Interlap01 merged 1 commit intoOct 26, 2026
Merged
Conversation
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.
Disk cleanup's recursive name matching included directories inside
Containers/Bundle. An installed app, extension, or framework containing packaged resources namedCaches,Logs, ortmpcould therefore have those resources reported as reclaimable and permanently deleted, despite app bundles being documented as durable storage.Skip the entire installed-bundle storage tree during name-based discovery. This keeps packaged resources out of both cleanup plans and deletion without changing normal cache, log, or temporary-file cleanup in app data containers.
Regression coverage exercises all three categories with resources in an app, embedded extension, and framework, alongside disposable app data. It checks plan bytes and target counts, installed-app storage measurement, resource preservation, actual disposable-file deletion, and target-directory preservation. All three subtests failed against the original implementation with deleted bundle files and pass with the fix.
Validation on macOS 26.6.2 / arm64, Go 1.27.1:
make check(full Go tests,go vet, Swift formatting lint, shell syntax, plist validation)go test -race -count=1 ./...VERSION=0.0.0 BUILD_NUMBER=1 make appgit diff --checkThe first race-enabled full run failed in the existing
TestReadLaunchdRetriesATimedOutReadtiming test, without a race report, while the app was also compiling. Five isolated repetitions of that test passed, followed by a fresh full race-enabled run passing. No retry or timeout code was changed; the exact cause of the initial timing failure is unconfirmed.All cleanup reproduction uses temporary filesystem fixtures. No real simulators were modified, and no real-simulator end-to-end cleanup validation was performed. Broader cleanup allowlisting and filesystem race hardening are outside this focused fix.