psst icon indicating copy to clipboard operation
psst copied to clipboard

Swap platform_dirs for directories for config paths

Open jacksongoode opened this issue 1 month ago • 5 comments

Old crate we can get rid of nicely.

jacksongoode avatar Nov 23 '25 08:11 jacksongoode

Thanks for the catch, I'm honestly not sure what the standard cache directories are for Windows, but having a Windows specific piece of logic here feels a little strange. Do you think we should rethink the organization of the config in cache locations with this and have some simple migration script that runs if the application detects otherwise?

jacksongoode avatar Nov 24 '25 06:11 jacksongoode

I haven't found a standard for cache/config directories for Windows, except for the general advice to use AppData/Local or AppData/Roaming for user-specific miscellaneous application data (Local is fine for our use-case). The directories library uses a deliberately opinionated folder structure for the various file groups (cache, config, etc.). They seem to be inspired by QT's conventions, though they even deviated from that.

Overall, I would say that if we opt for using directories, we should use their default folder structures, otherwise we can pick other less strict path resolving packages. A small benefit to sub-folders is that safe-to-delete folders like cached files will be easier to find.

A simple migration script should do the job, it can be deleted in a year or so I'd say.

Pogodaanton avatar Nov 24 '25 15:11 Pogodaanton

I tested the migration process on Windows. It worked, except for the missing country_code migration.

Thanks for the test! I need one more test on Linux to validate that it's all good.

jacksongoode avatar Nov 29 '25 07:11 jacksongoode

I'm on linux, what do I need to test?

Cleboost avatar Nov 29 '25 19:11 Cleboost

I'm on linux, what do I need to test?

In theory, nothing should have changed on Linux/macOS. That's what needs to be verified.

A quick smoke test is to verify whether you're still logged in when using this branch and whether your settings are the same as in previous versions. In settings under the section "cache", the size value should approximately (!) match the size in previous versions.

Pogodaanton avatar Nov 30 '25 15:11 Pogodaanton