-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[OS X] Use 10.10 Finder Sync icon indication #2340
Comments
Yes, this is the way to go; I suppose DropBox is using this, since the overlays were missing when I first upgraded to 10.10 and after a few weeks (ie. DB update), they came back, but different than ever before. |
I tried to get it to work by hacking things together but I'm currently stuck in a corner: the FinderSync requires sandboxing to be enabled for the app extension bundle, and that means in return that the code can only communicate through unix sockets with other sandboxed applications (of the same "application group") I tried to mark the current socket path with temporary sandbox exceptions, or to tell the client to open the server inside the app group container path and OS X obviously doesn't let me open the socket for listening. This means that we won't be able to use those fancy new icons unless we also make the desktop client application sandboxed. I'm assuming that this won't be trivial. |
A bit of research seem to reveal that it shouldn't be necessary to have the client sandboxed. This page suggests using XPC as communication, but this would require running the sync engine in a launchd service, this one probably also sandboxed: https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/Finder.html#//apple_ref/doc/uid/TP40014214-CH15-SW13 It could make sense to take the opportunity to split our syncing into a service. This would increase the security by sandboxing the communication with the server, would avoid UI lock-ups by avoiding doing the discovery on the client's main thread and allow using the FinderSync properly. The problem is that this will probably require quite some platform-specific code and the usual amount of bugs that this implies. Another option it to have the XPC service only used as an intermediate communication end-point between the client and the finder extension, but this would be a bit of a hack. |
I tried XPC and I couldn't find a way to use it without servicing it from a helper process that need to be launched from launchd. I got something working using an NSConnection to communicate from the sandboxed extension, that should work. I still need to find a way to update parent directories since I can't handle UPDATE_VIEW the same way, and also make sure that the old extension still work to support < 10.10. |
I got something working using an NSConnection to communicate from the sandboxed extension, that should work. I still need to find a way to update parent directories since I can't handle UPDATE_VIEW the same way, and also make sure that the old extension still work to support < 10.10. —Reply to this email directly or view it on GitHub. |
The client will update all file status when they change, I'm not sure what was the original purpose of UPDATE_VIEW, but in my case it seems like parent directories of synced files are the only one needing an force update (which UPDATE_VIEW triggers). For example: Once aaa through aac are done updating, UPDATE_VIEW is usually needed to get the OK status for a and aa, since a directory is marked as SYNC if any of it children are still syncing. So either I'll have to put the parent directory logic in UPDATE_VIEW, or even better put that logic directly in the SocketApi and get rid of the need for a force update in UPDATE_VIEW for all other plugins. |
I got it pretty well working in my temporary branch, most of the risk involved by the feature is cleared, But I still need to figure out how well that will work with non ad-hoc signing since the Mach port name needs to be prefixed by the signing team ID. Here is what I think is left to do
|
This prepares the switch to the official FinderSync API on Yosemite which requires the extension to run in a sandbox. This complicates the usage of a local socket to communicate with a non-sandboxed GUI client. An NSConnection is easier to use in this case, which we can use as long as the server name (i.e. Mach port registered name) is prefixed with the code signing Team Identifier. A placeholder server implementation is also added to the client's SocketApi which basically reproduces the interface of a QLocalSocket. Most of the references to individual sockets we're only using QIODevice methods so the type was simply reduced. A typedef to replace the QLocalServer was the only other part needed.
This uses the new official API to show overlay icons and add our custom context menu entry instead of hooking directly into the Finder process and intercept drawind routines. A dummy desktopclient target is also in the project to allow debugging directly in Xcode while the official client can be started from the command line. Otherwise Xcode won't allow attaching to the debugee. Dummy icon files have been added while we get proper icon produced. We can't use the old icons since what we use for the legacy shell integration is already padded according to where the badge should appear on the full icon.
It was only used on OS X and couldn't be used by the FinderSync extension since that one runs in a sandbox. So use the same system to load images in the legacy extension by shipping them in the extension bundle instead of the owncloud.app bundle. This is also given that the legacy extension needs padded icons while the FinderSync one needs unpadded icons.
shell_i: Add a FinderSync-based implementation #2340
I consider the feature done, but there are surely issues remaining, I added some quick testing info at https://github.com/owncloud/client/wiki/Testing-Scenarios-2.0 |
@jturcotte I need the steps to reproduce this issue. Thanks |
Install 2.0 nightly build on OS X. Check if sync indicator icons show up in finder. |
It is work ok. Many thanks |
Remove need for UPDATE_VIEW to refetch the status #2340
I just installed ownCloud-2.0.0.2666 on OS X 10.10.5 and since then the icons as well as the ownCloud finder actions (right click -> share with ownCloud) are gone. Both have been working with the 1.8.4 Client. Futhermore, where is #2897 implemented, I can't find any options like those mentioned there? Anyway, the most important thing, ownCloud 2.0 is syncing fine. Please let me know if I can provide something. |
@TomGem The extension loading is now handled by OSX directly instead of having to inject the bundle directly in Finder, so you can find the option in [System Preferences / Extensions / Finder] where you should be able to enable the "ownCloud Extensions" There are some situations where the extension wouldn't be enabled properly on the first install, but normally just enabling it there should make it available again. Let me know if that doesn't work for you. |
That's it, thank you very much! |
If running on 10.10:
https://developer.apple.com/library/mac/releasenotes/MacOSX/WhatsNewInOSX/Articles/MacOSX10_10.html
This would replace our overlay icon code.
https://developer.apple.com/library/mac/documentation/FinderSync/Reference/FinderSync_Framework/
The text was updated successfully, but these errors were encountered: