Skip to content

Fix secure erase directory and batch handling - #171

Merged
iliyami merged 1 commit into
iliyami:mainfrom
Borisserz:fix/shredder-secure-batch
Sep 21, 2026
Merged

iliyami merged 1 commit into
iliyami:mainfrom
Borisserz:fix/shredder-secure-batch

Conversation

@Borisserz

Copy link
Copy Markdown
Contributor

Summary

  • refuse directories in Secure Erase mode so their contents are never recursively deleted without overwrite
  • preserve the batch-size cap while validating and skipping unsafe paths per item
  • show shredder errors on the result screen instead of displaying unconditional success

Test Plan

  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer bash scripts/check-version-sync.sh
  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift build
  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test (809 tests, 3 skipped, 0 failures)
  • New RED/GREEN regression tests cover secure directories and mixed-validity batches
  • Tested in running app (not just compilation)

Screenshots

Not included; the result view only adds inline error text and a warning state.

Checklist

  • Code compiles with swift build
  • Follows existing code style (Swift 6, actors, @observable)
  • No force unwrapping added
  • File operations go through SafetyGuard
  • No telemetry or network calls added
  • PR is focused on the related shredder fixes

Closes #157
Closes #158

@iliyami

iliyami commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Important fix, verified: secure erase of a directory now throws before removeItem (previously it silently deleted the directory's contents with no overwrite, a fake secure erase). Batch now erases the safe subset and skips unsafe paths, each still validated by SafetyGuard; #112 symlink/throwing-overwrite guards intact. Merging. Thanks @Borisserz!

@iliyami
iliyami merged commit 4ac8a97 into iliyami:main Sep 21, 2026
2 checks passed
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.

Shredder aborts entire batch when one path fails validateDeletion Secure Erase on directories skips overwrite but still deletes

2 participants