Fix actor isolation crash in fetchReminders#4
Closed
Noah-Ribaudo wants to merge 1 commit into
Closed
Conversation
The fetchReminders method was calling self.item(from:) inside the EventKit callback closure, which runs on a different executor than the actor. This caused 'Incorrect actor executor assumption' crashes. Fix: Extract all data from EKReminder objects directly within the callback closure before crossing the isolation boundary, capturing the calendar beforehand to avoid actor-isolated property access.
Collaborator
|
Thank you! Reviewing... |
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Running
remindctl listcrashes with:Cause
The
fetchRemindersmethod callsself.item(from:)inside the EventKit callback closure. This callback runs on EventKit's executor, not the actor's executor, causing Swift's strict concurrency checking to abort.Fix
Extract all data from
EKReminderobjects directly within the callback closure before the data crosses the isolation boundary. Thecalendarproperty is captured beforehand to avoid accessing actor-isolated state from within the closure.Testing
Tested on macOS 15 (Sequoia) with Swift 6:
remindctl list✅remindctl list "List Name"✅remindctl add✅remindctl delete✅