automerge / automerge/MeetingNotes

update example code to make ReferenceFileDocument sendable

Open
#48 0 comments 0 reactions 1 assignee Claimed by @heckj View on GitHub
enhancement
Dominant language
Swift
Stars
75
Forks
1
PR merge metrics
No merged PRs in 30d

Description

latest Xcode (16) and associated SDKs have marked [ReferenceFileDocument](https://developer.apple.com/documentation/swiftui/referencefiledocument/) as Sendable. I inquired in the developer forums about this, and [the DTS engineer kindly explained](https://developer.apple.com/forums//thread/765302?answerId=807076022#807076022) that it has to be Sendable - which means adding some structure in there - because the various methods are called from a number of different isolation domains.

The gist is that the class holds ~3-4 properties that are all possibly mutating, and all of those need to be locked down to Sendable, so wrapped within an [OSUnfairAllocatedLock](https://developer.apple.com/documentation/os/osallocatedunfairlock) (as per updated [ReferenceFileDocument](https://developer.apple.com/documentation/swiftui/referencefiledocument/) code example).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.