Fix Swift 6 actor-isolation warnings in model inits and services
- Message, Conversation, EmailLog: add nonisolated to inits — plain value types have no actor isolation, but the macOS 27 SDK was inferring it - EncryptionService: replace lazy var encryptionKey (which mutates self and gets inferred as @MainActor) with an eagerly-initialized let in init() - FileLogger: add nonisolated to shared, write, and minimumLevel so they are callable from nonisolated AppLogger methods without warnings - LogLevel.<: add nonisolated to the Comparable conformance method Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -33,7 +33,7 @@ struct Conversation: Identifiable, Codable {
|
||||
var updatedAt: Date
|
||||
var primaryModel: String? // Primary model used in this conversation
|
||||
|
||||
init(
|
||||
nonisolated init(
|
||||
id: UUID = UUID(),
|
||||
name: String,
|
||||
messages: [Message] = [],
|
||||
|
||||
@@ -44,7 +44,7 @@ struct EmailLog: Identifiable, Codable, Equatable {
|
||||
let responseTime: TimeInterval? // Time to generate response in seconds
|
||||
let modelId: String? // Model that handled the email
|
||||
|
||||
init(
|
||||
nonisolated init(
|
||||
id: UUID = UUID(),
|
||||
timestamp: Date = Date(),
|
||||
sender: String,
|
||||
|
||||
@@ -66,7 +66,7 @@ struct Message: Identifiable, Codable, Equatable {
|
||||
// Reasoning/thinking content (not persisted — in-memory only)
|
||||
var thinkingContent: String? = nil
|
||||
|
||||
init(
|
||||
nonisolated init(
|
||||
id: UUID = UUID(),
|
||||
role: MessageRole,
|
||||
content: String,
|
||||
|
||||
Reference in New Issue
Block a user