Skip to content

Mark KeywordRankingScreenshotExportService as Sendable#6

Open
dustyberry1 wants to merge 1 commit into
hubab1:mainfrom
dustyberry1:fix/swift6-screenshot-export-sendable
Open

Mark KeywordRankingScreenshotExportService as Sendable#6
dustyberry1 wants to merge 1 commit into
hubab1:mainfrom
dustyberry1:fix/swift6-screenshot-export-sendable

Conversation

@dustyberry1

Copy link
Copy Markdown

Under Swift 6.2 with SWIFT_STRICT_CONCURRENCY = complete (the project's settings), the screenshot export Task captures the KeywordRankingScreenshotExportService instance created on the main actor and calls its async export(...) across an actor boundary, which fails to compile: 'sending exporter risks causing data races'.

The service is a final class whose only stored property is an already-Sendable ScreenshotDownloadService, with no mutable state, so it is safe to declare Sendable. This unblocks building on Xcode 26.5.

Under Swift 6.2 with SWIFT_STRICT_CONCURRENCY = complete (the project's
settings), the screenshot export Task captures the
KeywordRankingScreenshotExportService instance created on the main actor and
calls its async export(...) across an actor boundary, which fails to compile:
'sending exporter risks causing data races'.

The service is a final class whose only stored property is an already-Sendable
ScreenshotDownloadService, with no mutable state, so it is safe to declare
Sendable. This unblocks building on Xcode 26.5.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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