Skip to content

fix: preserve installed bundles during disk cleanup - #64

Merged
Interlap01 merged 1 commit into
MobAI-App:mainfrom
sunjinshuai:codex/protect-installed-bundles
Oct 26, 2026
Merged

Interlap01 merged 1 commit into
MobAI-App:mainfrom
sunjinshuai:codex/protect-installed-bundles

Conversation

@sunjinshuai

Copy link
Copy Markdown
Contributor

Disk cleanup's recursive name matching included directories inside Containers/Bundle. An installed app, extension, or framework containing packaged resources named Caches, Logs, or tmp could 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 app
  • App bundle signature verification, bundle metadata, and bundled CLI version checks
  • Go formatting and git diff --check

The first race-enabled full run failed in the existing TestReadLaunchdRetriesATimedOutRead timing 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.

@Interlap01 Interlap01 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@Interlap01
Interlap01 merged commit d594c23 into MobAI-App:main Oct 26, 2026
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.

2 participants