PaywallEventStore: changed container to use URL.applicationSupportDirectory#3289
Merged
NachoSoto merged 3 commits intoOct 9, 2023
Conversation
…Directory` See https://nemecek.be/blog/57/making-files-from-your-app-available-in-the-ios-files-app#writing-files-into-the-application-support-directory Unfortunately the choice of `URL.documentsDirectory` meant that any app wanting to make its documents accessible via the Files app, would have exposed these events.
aboedo
approved these changes
Oct 7, 2023
6cf4a33 to
7a9b75b
Compare
7a9b75b to
c83596b
Compare
aboedo
approved these changes
Oct 9, 2023
|
|
||
| let documentsDirectory = try documentsDirectory ?? Self.documentsDirectory | ||
| let url = documentsDirectory | ||
| Self.removeStoreIfExists(Self.url(in: documentsDirectory)) |
Member
There was a problem hiding this comment.
maybe we can call this something like removeLegacyDirectoryIfExists so it's obvious at first glance what we're doing and why?
NachoSoto
added a commit
that referenced
this pull request
Oct 18, 2023
Fixes #3316. Follow up to #3289. That previous fix was only removing the store itself, but not the `revenuecat` folder. Running an app with 4.27.2 produces this: ```bash $ tree -L 3 ~/Library/Developer/CoreSimulator/Devices/.../data/Containers/Data/Application/.../ ~/Library/Developer/CoreSimulator/Devices/.../data/Containers/Data/Application/.../ ├── Documents │ └── revenuecat │ └── paywall_event_store ``` After this fix, the Documents directory is empty. ```bash tree -L 4 ~/Library/Developer/CoreSimulator/Devices/.../data/Containers/Data/Application/.../ /Users/ignacio/Library/Developer/CoreSimulator/Devices/.../data/Containers/Data/Application/.../ ├── Documents ├── Library │ ├── Application Support │ │ └── revenuecat │ │ └── paywall_event_store ```
This was referenced Oct 18, 2023
NachoSoto
added a commit
that referenced
this pull request
Oct 18, 2023
…ory (#3317) Fixes #3316. Follow up to #3289. That previous fix was only removing the store itself, but not the `revenuecat` folder. Running an app with 4.27.2 produces this: ```bash $ tree -L 3 ~/Library/Developer/CoreSimulator/Devices/.../data/Containers/Data/Application/.../ ~/Library/Developer/CoreSimulator/Devices/.../data/Containers/Data/Application/.../ ├── Documents │ └── revenuecat │ └── paywall_event_store ``` After this fix, the Documents directory is empty. ```bash tree -L 4 ~/Library/Developer/CoreSimulator/Devices/.../data/Containers/Data/Application/.../ /Users/ignacio/Library/Developer/CoreSimulator/Devices/.../data/Containers/Data/Application/.../ ├── Documents ├── Library │ ├── Application Support │ │ └── revenuecat │ │ └── paywall_event_store ``` This is still covered by the same test introduced in #3289.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
See https://nemecek.be/blog/57/making-files-from-your-app-available-in-the-ios-files-app#writing-files-into-the-application-support-directory
Unfortunately the choice of
URL.documentsDirectorymeant that any app wanting to make its documents accessible via the Files app,would have exposed these events.