Skip to content

Fix force termination access denied crash - #2

Merged
ZheLZZ merged 2 commits into
mainfrom
codex/fix-force-termination-crash
Aug 6, 2026
Merged

ZheLZZ merged 2 commits into
mainfrom
codex/fix-force-termination-crash

Conversation

@ZheLZZ

@ZheLZZ ZheLZZ commented Aug 6, 2026

Copy link
Copy Markdown
Owner

What changed

  • Recognize access-denied errors wrapped by AggregateException when Windows cannot terminate every process in a process tree.
  • Return the existing AccessDenied result so TrayTidy can continue into its administrator-elevation flow instead of terminating the WPF application.
  • Contain unexpected termination-service exceptions at the current cleanup operation, record a safe failure message, and keep the main interface running.
  • Add regression coverage for wrapped access-denied errors, other aggregate failures, and command-level exception containment.
  • Update the application version to 0.2.1-beta.

Why

Process.Kill(entireProcessTree: true) can throw an AggregateException whose inner exception is Win32 error 5 (Access is denied). The previous implementation caught only a direct Win32Exception, so the wrapped error bypassed the administrator-elevation branch, reached the WPF dispatcher, displayed a fatal interface-error dialog, and exited TrayTidy.

User impact

Protected or privileged background processes now follow the expected Windows administrator-confirmation path. If Windows or a termination provider returns another unexpected error, TrayTidy reports the individual operation as unsuccessful without closing the whole application.

This change does not alter recommendation scores, default selections, protection rules, process-identity validation, foreground-window checks, modal-dialog checks, or the requirement for explicit user confirmation before force termination.

Validation

  • Full Release test suite: 142 passed (Core 47, Persistence 14, Windows integration 30, AI 51).
  • Self-contained win-x64 publish completed successfully with product version 0.2.1-beta.
  • Release ZIP extracted and compared file-by-file with the publish directory using SHA-256.
  • Package contains no PDB, database, log, environment, or private-key files.

@ZheLZZ
ZheLZZ marked this pull request as ready for review August 6, 2026 07:59
@ZheLZZ
ZheLZZ merged commit f11c658 into main Aug 6, 2026
1 check 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.

1 participant