Skip to content

Address Swift 6 Sendable/concurrency warnings #2

Description

@james-cantonwine

Summary

Multiple warnings related to Swift 6 strict concurrency checking need to be resolved before adopting Swift 6 language mode.

Current Warnings

PersistentModel Sendable conformance (7+ instances)

  • TranscriptionService.swiftTranscript passed across actor boundaries
  • AnalysisService.swiftAnalysis passed across actor boundaries
  • VideoAnalysisService.swiftAnalysis passed across actor boundaries

These all follow the same pattern: SwiftData @Model classes are used as return values from Task blocks, crossing actor isolation boundaries. The compiler warns that PersistentModels are not Sendable.

Main actor isolation

  • ServiceContainer.swift:76shared static property referenced from nonisolated context

Suggested Approach

  • Evaluate ModelActor pattern for service layer
  • Alternatively, pass persistentModelID across boundaries and re-fetch on the target actor
  • Consider scoping this work to when the project is ready to adopt Swift 6 language mode

Additional (minor)

  • ExportService.swift:89mediaBox should be let instead of var

Context

These warnings were identified during the multi-chat sessions feature implementation. They are pre-existing and unrelated to that feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions