4 ms·
Bookmarks are great in theory, but in practice they have a few issues: 1) The API is poorly documented, and behaves differently on different macOS versions 2)
by jakobegger 9y ago
Bookmarks are great in theory, but in practice they have a few issues:
1) The API is poorly documented, and behaves differently on different macOS versions
2) Error reporting is really bad. Sometimes “opening” a bookmark fails, and there’s no indication why. The error message suggests that the user should change permissions in Finder, which is incorrect and misleading
3) It’s really easy to forget to “close” bookmarks, leading to leaked kernel resources (which might be one reason for 2)
4) Issues with code signing or the keychain can cause bookmarks to silently fail to open. There are no error messages that suggest this is the case, the only way to fix these problems is to search Google and try random things until it starts working again.
Bookmarks, just like the whole sandbox API, are a good idea in theory, but they suffer from poor documentation and extremely poor error reporting, making them unreliable. It’s no wonder developers are reluctant to adopt the sandbox unless they want to distribute their app on the App Store.
- kitsunesoba 9y agoI haven’t worked with these APIs for a couple of macOS versions but yeah, this reflects my experience too. It’s enough of a frustration that if your application works with arbitrary files often, it might be necessary to opt out of sandboxing (and the App Store) if you want to ensure a consistent experience for users and don’t have the time or resources to test your way through all possible failures. Maybe this area will get some attention with the rumored upcoming AppKit replacement.
- jakobegger 9y agoI strongly doubt that an AppKit replacement would fix the sandbox issues. Also, to be fair, I think that quality of the sandbox has improved significantly over the years. The remaining issues are in general pretty rare (my apps have thousands of users, and I only get a handful of support requests about these issues per year). The problem is that when these issues pop up, there is nothing I can do to debug them -- aside from asking users "have you tried rebooting your computer?" (which does fix the issues occasionally) Apple really needs to make better error reporting. When opening a security scoped bookmark fails, the system should return a proper error message, or at least log the reason for the failure. And they must absolutely fix their error messages. When the sandbox denies access to a file, AppKit shouldn't suggest changing permissions in the Finder -- that won't help a thing.
- IMcD23 9y agoDo you have any links to Radars you have filed with Apple? I’d love to see more about these issues.
- jakobegger 9y agoI’ve filed two radars in 2012 about sandbox issues I was able to reproduce (10729027 and 10729035). They were both marked as dupes and closed in 2012 and 2016, respectively. I haven’t filed radars about the other issues since I was never able to reproduce them (only received customer reports). I haven’t seen any reports since the release of 10.13, though. I should probably file radars for the poor documentation and the misleading error message.