Post

Replies

Boosts

Views

Activity

FileProvider Testing Setup
TL:DR Can anyone provide guidance as to how to get the FileProvider testing API to work? It closes with no error and I have not been able to determine the issue despite careful attention to the documentation and signing. The Console logs seem to imply it is a Sandbox issue. Hi, Writing this as per suggested in the technical support section. I am trying to create some tests that involve controlling the calls from MacOS to the corresponding "event" functions in the FileProvider (e.g. fetchContents()) using the FileProviderExtension test API provided by Apple. I have thoroughly read the documentation (both online and within the API code) in order to get this to work. I have: Added the com.apple.developer.fileprovider.testing-mode entitlement to both my Main App as well as my FileProviderExtension Ensured my I have the correct account permissions, and provisioning profiles for my Main App as well as FileProviderExtension Added the line domain.testingModes = [.alwaysEnabled, .interactive] The issue: I found that setting the .interactive option in my domain.testingModes will result in my domain in Finder appearing to be stuck loading the root folder, and that my FileProviderExtension instance is being invalidated and closing in ~5s. It is reproducible. Is this a bug? Some things I have noticed: Attaching the debugger to the FileProviderExtension process results in no error. Additionally there is no error received when calling add(:domain). I noticed through testing that the Main App appears to be required to have the com.apple.developer.fileprovider.testing-mode entitlement in order to run a FileProviderExtension with that same entitlement. Otherwise I would receive the error: Error Domain=NSCocoaErrorDomain Code=257 "The file couldn’t be opened because you don’t have permission to view it" When trying to sign manually using a group Developer ID Application certificate as opposed to automatically with my Apple Development certificate Xcode presents the error "Main app provisioning profile" doesn't support the FileProvider Testing Mode capability." Despite this I can clearly see that is an enabled capability though the online Apple Developer portal under the Profiles section. Note that the only capabilities enabled when viewing the bundle identifiers of the Main App and FileProviderExtension are "FileProvider Testing Mode", "App Groups", and the (seemingly required) "In-App Purchases". I later realized that this was likely due to using the wrong type of provisioning profile so I generated and switched to MacOS Developer Profiles (as opposed to Distribution) and this error in XCode went away. However the above issue (FileProviderExtension instance being invalidated) persisted. If I look at the Console I see various errors from when the extension is launched till it closes: Sandbox: mdbulkimport(922) deny(1) mach-lookup com.apple.FileProvider Sandbox: hiveDiskProvider(37981) deny(1) mach-lookup com.apple.mobile.keybagd.UserManager.xpc [ERROR] Cannot query for providers. Error: NSError: Cocoa 4099 "<private>" Error from beginMonitoringProviderDomainChangesWithHandler: Error Domain=NSCocoaErrorDomain Code=4099 UserInfo={NSDebugDescription=<private>} Synchronizer coordinateReadingItemAtURL error: Error Domain=NSCocoaErrorDomain Code=3072 With the Development Provisioning Profiles I see a couple new errors: From secinitd(App Sandbox) Failed to set LS data container personality info: <private> A new error repeated a number of times from cfprefsd after trying to access some .plist files that don't appear to be on my system: Error: Couldn't open parent path due to [2: No such file or directory] Paths are: ~/Library/Containers/<extensionBundleID>/Data/Library/Preferences/ByHost/<extensionBundleID>.<ID>.plist /Library/Managed Preferences/<username>/<extensionBundleID>.plist Any help would be greatly appreciated :)
3
0
711
Apr ’24
Cannot Evict Items from File Provider
Has anyone else been unable to trigger item eviction? Note I am using MacOS Sonoma 14.1 on a Macbook Air M1. I have attempted using both the swift API myFileProviderManager.evictItem(myItemID) as well as the CLI tool fileproviderctl evict "path/to/myFile.txt" and both return Error Domain=NSFileProviderErrorDomain Code=-2008 "The file ‘myFile.txt’ cannot be evicted.". This error maps to the nonEvictable error. Therefore I attempted providing the necessary permissions to evict my file. I have attempted applying all 4 possible configurations of NSFileProviderContentPolicy to this file. I have tried the legacy option of using the capability .allowsEviction. I have even tried with NSExtensionFileProviderAllowsUserControlledEviction set to both YES and NO as I noticed Dropbox was able to evict items even though this option was set to NO. None of these attempts have succeeded. I noticed if I ran fileproviderctl evict "path/to/myFile.txt" --namespace I was able to see that the file has the contentPolicy of 1 which maps to the downloadLazily contentPolicy. The NSFileProviderContentPolicy code documentation states that with this configuration will "Allow eviction on low disk pressure and other triggers." For clarity here is a table of my various attempts with NSExtensionFileProviderAllowsUserControlledEviction set to YES: NSFileProviderContentPolicy With Evict Capability Without Evict Capability None (i.e. default) 2008 Failed to evict 2008 Failed to evict inherited 2008 Failed to evict 2008 Failed to evict downloadLazily 2008 Failed to evict 2008 Failed to evict downloadEagerlyAndKeepDownloaded 2008 Failed to evict 2008 Failed to evict downloadLazilyAndEvictOnRemoteUpdate 2008 Failed to evict 2008 Failed to evict What am I missing? Is the documentation outdated? Is this a bug? Any tips will be greatly appreciated!
1
0
1.1k
Nov ’23
FileProvider fails to instantiate from /Applications folder
Hi, So I am bundling a FileProvider Extension with my electron application and have noticed a very strange behavior. When I package my application and install/launch it from any directory everything runs perfect. However the exception is when I install it to/launch it from the /Applications folder. Specifically I receive Cannot create domain: Error Domain=NSFileProviderErrorDomain Code=-2001 "The application cannot be used right now." which maps to providerNotFound. Seems that the provider is failing to instantiate altogether, and therefore I lack any extension functionality. After I have run the app from the /Applications folder once if I try and run the app from any other directory it fails and I get the same error message. Anybody have any clues as to what may be changing in my environment that driving this behavior?
3
2
1.5k
May ’23