Conflicts drawing badges when running multiple Finder Sync extensions

There is an unfortunate behavior when multiple Finder Sync extensions are simultaneously running. If two or more Finder Sync extensions are configured to watch the same folders by setting [FIFinderSyncController defaultController].directoryURLs, then there's a race condition where badges will only be requested ( via requestBadgeIdentifierForURL) and drawn from the extension that started first.


Normally, this wouldn't be an issue if extensions are only watching the folders they created, but Dropbox for instance seems to monitor the entire ~/Documents folder (not just their own "Dropbox" folder), so if the "Dropbox Finder Integration" extension runs first, no other extension will show its file badges.


So what is the expected behavior if two Finder Sync extensions are watching the same folders? There needs to be some intelligent logic to determine which extension gets to show its badges (maybe whoever has registered the folder "closest" to the actual folder, so whoever is monitoring "~/Documents/MyFolder" would win out over whoevers monitoring "~/Documents" when drawing icons for the files in MyFolder.

I was seeing all sorts of strange behavior with the display of badges and I only just now discovered that it was caused by DropBox monitoring the Documents folder.


Dropbox is just doing this because they want to be able to display their "Move to Dropbox" menu item for the contents of the Documents folder.


The folders I want to monitor are also in the Documents folder and I also want to provide the user with a menu item to move files into my monitored folders.


From what I have learned from experimentation is that the first extension to be activated gets control of the badges in the monitored folders. So what seems to work is: after activating my extension I deactivate the DropBox extension and then reactivate it again. The result is that my extension now has control of the badges in my monitored folder under Documents. The Dropbox extension continues to work because I am not monitoring the Dropbox folder and DropBox is not interested in setting badges in the Documents folder and its menu entry is still displayed.


What Apple needs to do is to provide some way to distinguish between folders that are being watched for the purpose of setting badges and those that are being watched for the purpose of providing menu items.

Conflicts drawing badges when running multiple Finder Sync extensions
 
 
Q