fix(clean): preserve nested E5RT caches - #1264
Merged
Merged
Conversation
The container-only guard left the same failure reachable through clean_user_essentials: ~/Library/Caches/* removes each top-level entry, and com.apple.duetexpertd / com.apple.Spotlight both hold an E5RT bundle cache one level down. clean_app_caches also wiped the shared com.apple.e5rt.e5bundlecache outright. Same breakage, same daemons. Move the rule into holds_compiled_model_cache() next to the other shared protection predicates and apply it in safe_clean() as well, so the container sweep and the plain cache sweep agree. Drop the explicit E5RT cleanup target that now contradicts it. The regression test passed with the fix reverted: its assertions sit at the tail of a heredoc that bash never reaches, so the script exits 0 with the cache already deleted. Report state from the inner script and assert on $output instead, and cover the non-container path through safe_clean.
Owner
|
Merged, thanks for the careful writeup and the E5RT Code 13 repro, that made the root cause obvious. I extended the fix a little before merging: the same cache is also reachable through the non-sandboxed |
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.
Summary
Safety Review
Tests
Automated tests:
Manual checks:
~/Library/Containers//Data/Library/Caches//com.apple.e5rt.e5bundlecache
Additional Context
This was reproduced with a sandboxed OCR application using Apple TextRecognition:
The fix is generic and matches the E5RT cache marker rather than a specific application bundle ID.
Safety-related changes