Skip to content

Fix Swift 6 actor-isolation warning in InspectDomainIntent#3

Merged
ccleberg merged 1 commit into
mainfrom
fix/inspect-intent-actor-isolation
Jul 17, 2026
Merged

Fix Swift 6 actor-isolation warning in InspectDomainIntent#3
ccleberg merged 1 commit into
mainfrom
fix/inspect-intent-actor-isolation

Conversation

@ccleberg

Copy link
Copy Markdown
Member

What

Marks InspectDomainIntent.perform() as @MainActor to resolve a Swift 6 language-mode error surfaced as a warning today:

DomainDigIntents.swift:38 Expression is 'async' but is not marked with 'await'; this is an error in the Swift 6 language mode

Why

The app target sets SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor, so DomainReportBuilder and DomainInspectionService are MainActor-isolated. The unmarked perform() ran nonisolated, so the synchronous DomainReportBuilder().build(from:) call needed an actor hop. Rather than scatter awaits, this marks perform() @MainActor to match the sibling AddToWatchlistIntent.perform(). The network work still suspends via await inspectSnapshot(...), so the main actor is not blocked.

Verification

  • xcodebuild build (scheme DomainDig, iOS 26 simulator) → BUILD SUCCEEDED
  • Zero is 'async' but is not marked with 'await' warnings remain in the build log

The app target sets SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor, so
DomainReportBuilder and DomainInspectionService are MainActor-isolated. The
unmarked perform() ran nonisolated, so calling build(from:) triggered an
"expression is 'async' but is not marked with 'await'" warning (an error in the
Swift 6 language mode). Mark perform() @mainactor to match AddToWatchlistIntent.
@sonarqubecloud

Copy link
Copy Markdown

@ccleberg ccleberg self-assigned this Jul 17, 2026
@ccleberg ccleberg added the bug Something isn't working label Jul 17, 2026
@ccleberg
ccleberg merged commit 685f84a into main Jul 17, 2026
2 checks passed
@ccleberg
ccleberg deleted the fix/inspect-intent-actor-isolation branch July 17, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant