Skip to content

audit: simplify presentation task cancellation checks - #150

Merged
StanleyLl0yd merged 3 commits into
mainfrom
audit/async-cancellation-guard-simplification
Oct 12, 2026
Merged

StanleyLl0yd merged 3 commits into
mainfrom
audit/async-cancellation-guard-simplification

Conversation

@StanleyLl0yd

Copy link
Copy Markdown
Owner

Owner-requested repository-wide audit #145.

Exact starting main: d5906be1bf04139c673f2746954e8ed94d1502e4.

Scope: behavior-preserving simplification of the synchronous cancellation guards used by Tree, Search, Largest Files, and Sunburst derived presentation preprocessors.

  • Replace four identical withUnsafeCurrentTask { task in task?.isCancelled ?? false } computed properties with the standard Swift 6 Task.isCancelled access at the existing guard sites.
  • Preserve existing short-circuit positions and nil/cancellation contracts; do not change async state machines or UI behavior.
  • Add a focused test that cancels the current detached task and asserts all four preprocessors return nil rather than publishing work.
  • Independent Linux Swift 6.2.1 syntax/semantics probe showed equality of both cancellation reads outside a task and within a cancelled task. This is supplementary only; macOS Xcode 26.6 XCTest and CodeQL are decisive.

Exactly three changed files: ContentView.swift, Utilities.swift, DiskUsageTests/FolderUsageTests.swift.
No scanner, model, filesystem, Trash, resource, release, CI, dependency or roadmap change.

Hold merge until prior #149 exact-main is fully green, and this PR's own exact-head CI/Security/Dependency Review/CodeQL Actions+Swift and zero review threads pass. Verify merged main afterward.

@StanleyLl0yd
StanleyLl0yd merged commit 9087d74 into main Oct 12, 2026
8 checks passed
@StanleyLl0yd
StanleyLl0yd deleted the audit/async-cancellation-guard-simplification branch October 12, 2026 14:02
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