Skip to content
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

CmdlineArgs: Move config directory to a user-accessible location on iOS #12688

Merged
merged 1 commit into from Jan 29, 2024

Conversation

fwcd
Copy link
Member

@fwcd fwcd commented Jan 29, 2024

Currently, Mixxx uses the default config directory both on iOS and macOS, namely

<sandbox home>/Library/Application Support/Mixxx

On macOS this is a fine choice since the user can access the file system normally via Finder, on iOS, however, only <sandbox home>/Documents is accessible to the user, via the Files app. For Mixxx, making the config directory accessible to the user has a number of benefits, including

  • The ability to back up the mixxxdb
  • Transparency to the user how disk storage is used (and the ability to clean up e.g. analysis files themselves)
  • Access to log files which could be useful for debugging
  • The ability to manually change configs if needed

For this reason, this PR proposes to move the default config directory, on iOS only, to

<sandbox home>/Documents/Library/Application Support/Mixxx

...thus letting the user browse this directory:

For more information about the iOS file system conventions, see https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html.

@fwcd fwcd added the ios label Jan 29, 2024
@fwcd fwcd mentioned this pull request Jan 29, 2024
48 tasks
@daschuer
Copy link
Member

This is a kind of hack around system requirements. I am afraid some normal backup scripts or other things will be tricked.

Do we have alternatives? Is there an established way for storing data in the Documents folder?

Maybe we should start like default, but add a helper that import and exports to the Document Directory or such.
This will help even on other targets where less technical user struggle with such tasks.

@fwcd
Copy link
Member Author

fwcd commented Jan 29, 2024

It's actually surprisingly common for apps to dump their configs into a documents directory (of all apps, my bank app does it, though I don't really know why).

I am afraid some normal backup scripts or other things will be tricked.

Both backups and iCloud sync respect both the documents folder and the (hidden) library folders.

Do we have alternatives?

Sadly, iOS offers no other ways for the user to access files.

Is there an established way for storing data in the Documents folder?

Not really. Each app implements their own directory layout, I've tried to follow the "standard" iOS/macOS layout as closely as possible here. Even if Documents/Library/Application Support is technically a non-standard path, it uses the same terms (and same layout) as the standard configs, thus making it easily googleable.

add a helper that import and exports to the Document Directory or such

I feel like this would add a lot of complexity with little benefit. If it's a manual process, it will likely get tedious and if automated we'll duplicate data and risk getting out-of-sync. IMO, setting the config directory manually is the cleanest way around this with a number of advantages:

  • If anything goes wrong, it's easy to tell the user where to look, what to delete etc.
  • With the default location, the user has effectively no control over the library folder. If something goes wrong, they can't access any logs. In the worst case, the user would have to reinstall the app (deleting the entire sandbox, potentially including recordings etc.). With this solution, the user could simply delete the Library folder to start over.
  • Controller mappings are user-accessible this way, and the button in the settings can link the user to the files app

@fwcd
Copy link
Member Author

fwcd commented Jan 29, 2024

Another IMO underrated advantage of having the config directory in the user-accessible documents directory is that all files should up in the storage view:

The default directory would leave the user wondering where all their space went while the analysis data silently occupies it.

@JoergAtGithub
Copy link
Member

LGTM! Thank you!

@JoergAtGithub JoergAtGithub merged commit 87e6818 into mixxxdj:main Jan 29, 2024
12 checks passed
@fwcd fwcd deleted the ios-config-dir branch January 29, 2024 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants