From 46fef7bd3e3ae0bda49fc0ccd937f0cffc7a3c05 Mon Sep 17 00:00:00 2001 From: Nick Jensen Date: Tue, 6 Jan 2026 16:05:07 +1200 Subject: [PATCH] Fix actor isolation crash on macOS 26 (Tahoe) The fetchReminders callback from EventKit runs on an arbitrary thread, but was accessing actor-isolated state (self.item(from:)) which causes a runtime crash in Swift 6's strict concurrency checking. Fix: Capture the calendar before entering the callback, then use it directly inside to avoid actor isolation violations. Fixes #1 --- Sources/RemindCore/EventKitStore.swift | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Sources/RemindCore/EventKitStore.swift b/Sources/RemindCore/EventKitStore.swift index 50dd79c..b0f9dc2 100644 --- a/Sources/RemindCore/EventKitStore.swift +++ b/Sources/RemindCore/EventKitStore.swift @@ -204,11 +204,22 @@ public actor RemindersStore { } private func fetchReminders(in calendars: [EKCalendar]) async -> [ReminderItem] { - await withCheckedContinuation { continuation in + let cal = self.calendar + return await withCheckedContinuation { continuation in let predicate = eventStore.predicateForReminders(in: calendars) eventStore.fetchReminders(matching: predicate) { reminders in let mapped = (reminders ?? []).map { reminder in - self.item(from: reminder) + ReminderItem( + id: reminder.calendarItemIdentifier, + title: reminder.title ?? "", + notes: reminder.notes, + isCompleted: reminder.isCompleted, + completionDate: reminder.completionDate, + priority: ReminderPriority(eventKitValue: Int(reminder.priority)), + dueDate: reminder.dueDateComponents.flatMap { cal.date(from: $0) }, + listID: reminder.calendar.calendarIdentifier, + listName: reminder.calendar.title + ) } continuation.resume(returning: mapped) }