Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
HockeySDK 4.0 for Mac and iOS excludes the entire Application Support folder from backups #66
I discovered today that my entire ~/Library/Application Support/ folder was being excluded from Time Machine backups, due to the extended attribute com.apple.metadata:com_apple_backup_excludeItem being set. I eventually tracked down the cause to the HockeyApp for Mac app, I assume starting with version 2.0.15 released on 2016-03-16. If I delete the folder ~/Library/Application Support/com.microsoft.HockeyApp/ and launch the app, the extended attribute is set again.
I believe the cause of the problem is HockeySDK 4.0, since HockeyApp for Mac includes version 4.0.0-alpha.2. Digging through the HockeySDK source code, I found the method createDirectoryStructureIfNeeded in Classes/Telemetry/BITPersistence.m. This method sets NSURLIsExcludedFromBackupKey to YES on appSupportURL, which is the parent app's entire Application Support folder.
I'm not sure what the intention was with this code. Comments discuss excluding the folder from iCloud backup, so I assume it came over from the iOS version of the SDK. I've confirmed the same file and code is present there. Even so it should not be setting this flag on the entire Application Support folder. Even in a sandboxed app that folder can contain user data for the app. I'm guessing the intention was to exclude the "com.microsoft.HockeyApp" folder, which is the parent folder of kTelemetryDirectoryPath and kMetaDataDirectoryPath.
It looks like this bug has been present since this file was first added. Hopefully that means the bug was not present on any platform until version 4.0 of the SDK. Whatever the case, it would be appropriate to warn users of both the app and SDK so they can unset the flag if needed. I imagine most developers do not want to exclude their app's entire Application Support folder from iCloud backups on iOS or Time Machine backups on OS X.
thank you for reporting this bug. The initial idea was to exclude ONLY telemetry data from backups and not the entire Application Support folder. We apologize for this mistake and will fix this issue immediately.
I'll get back to you once the bugfix has been released.
Thanks for the thorough and detailed investigation and analysis, @robotspacer! Over the last two days we've investigated this problem and released fixes for the affected versions of both the iOS and Mac SDKs. More details about the fix can be found on our blog here: https://www.hockeyapp.net/blog/2016/05/04/hockeysdk-ios-mac-4-0-1-release.html