This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[ios] Move cache.db to a subdirectory #5601
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We cannot guarantee that cache.db will be created in a timely manner, so it's safer to set the backup exclusion key on its containing directory. But, because we placed cache.db in the base of the app's Application Support directory (where backups are expected to be allowed), we need to move cache.db into a directory that we control and can exclude from backups with impunity.
friedbunny
added
bug
iOS
Mapbox Maps SDK for iOS
macOS
Mapbox Maps SDK for macOS
offline
labels
Jul 7, 2016
~/Library/Application Support/tld.app.bundle.id/mapbox/cache.db | ||
*/ | ||
+ (NSURL *)cacheURL { | ||
return [[self class] cacheURLIncludingSubdirectory:YES]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self
is already the class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might as well inline this method since it's so simple.
} | ||
cacheDirectoryURL = [cacheDirectoryURL URLByAppendingPathComponent:bundleIdentifier]; | ||
if (useSubdirectory) { | ||
cacheDirectoryURL = [cacheDirectoryURL URLByAppendingPathComponent:@"mapbox"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd go with something even less likely to conflict with developer code, such as .mapbox
. For that matter, I wonder if dot-directories are even backed up to iCloud or Time Machine in the first place.
... it's late, I've been drinking.
👍 |
1 similar comment
👍 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Per confirmation from @jfirebaugh, we cannot guarantee that the offline and ambient cache.db will be created in a timely/synchronous manner, so it's safer to set the backup exclusion key on its containing directory.
But, because we placed cache.db in the base of the app's Application Support directory (where backups are expected to be allowed), we need to move cache.db into a directory that we control and can exclude from backups with impunity.
This is an amalgam of #5578 (directory exclusion) and #5585 (refactored URL methods, but without the new database size method).
/cc @1ec5 @boundsj @dapetcu21