Access to related files outside Sandbox with NSFileCoordinator and NSFilePresenter does not work anymore in macOS 27.3 beta 2

In macOS 27.3 beta 2, it is no longer possible to use NSFileCoordinator with NSFilePresenter instances to open a SQLite file with related WAL and SHM files when a sandboxed app has access to the primary SQLite file. In macOS 27.3 beta 1 and previous macOS releases, the Related File Access API works as expected.

This happens regardless where the files are located, so it seems to be unrelated to recent changes in Privacy & Security, although it could be an unexpected side effect of these changes.

Instead of correctly registering NSFilePresenter instances, errors like the following are logged in the XCode console:

NSFileSandboxingRequestRelatedItemExtension: Failed to issue extension for /Users/testuser/Desktop/Sample/Example.sqlite-wal because: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" (The related item is protected by a different storage class than the primary item) UserInfo={NSDebugDescription=The related item is protected by a different storage class than the primary item}
+[NSFileCoordinator addFilePresenter:] could not get a sandbox extension. primaryPresentedItemURL: file:///Users/testuser/Desktop/Sample/Example.sqlite, presentedItemURL: file:///Users/testuser/Desktop/Sample/Example.sqlite-wal

The mentioned Related File Access API is documented here.

I have filed a Feedback, which includes a sample project: FB25625743

My question is: Is this a bug, or new intended behavior, or is there something else changed that should be dealed with when using this API in macOS 27.3 beta 2?

Answered by DTS Engineer in 917620022
Written by elemans in 858304021

I have filed a Feedback, which includes a sample project: FB25625743

Thanks. That’s the best path for this IMO.

Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Written by elemans in 858304021

I have filed a Feedback, which includes a sample project: FB25625743

Thanks. That’s the best path for this IMO.

Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"