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

Chaning directories for logs and state files #7868

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brainrom
Copy link

Fix for #3406 and #7654.

And cookie jar now also stores in StateLocation, because it's app state and not configuration. Added corresponding migration function.

Shouldn't negatively affect Windows and Mac OS, because StateLocation on these platforms are subdirectories of AppConfigLocation.

From Qt doc:

Path type macOS Windows
AppConfigLocation "~/Library/Preferences/<APPNAME>" "C:/Users/<USER>/AppData/Local/<APPNAME>", "C:/ProgramData/<APPNAME>"
StateLocation "~/Library/Preferences/<APPNAME>/State" "C:/Users/<USER>/AppData/Local/<APPNAME>/State", "C:/ProgramData/<APPNAME>/State"

@brainrom brainrom changed the title logs and cookies moved to state path Chaning directories for logs and state files Feb 17, 2025
@camilasan
Copy link
Member

Shouldn't negatively affect Windows and Mac OS, because StateLocation on these platforms are subdirectories of AppConfigLocation.

Do you have access to Mac and/or Windows to check it?
Could you try adding testing for this change?

@brainrom
Copy link
Author

brainrom commented Feb 27, 2025

Do you have access to Mac and/or Windows to check it?

I can try build and check on Windows, but have absolutely no idea how to build and check on Mac.

Could you try adding testing for this change?

What kind of testing?

@camilasan
Copy link
Member

I can try build and check on Windows, but have absolutely no idea how to build and check on Mac.

On Windows it would already help.

What kind of testing?

Sorry, I mean tests. Unit/code tests.

@brainrom
Copy link
Author

brainrom commented Feb 27, 2025

On Windows it would already help.

Ok, then I'll manually test it on Windows.

Sorry, I mean tests. Unit/code tests.

Nextcloud currently don't have tests for similar things, not configs, nor migration. What exactly should I test? I can make test for tryMigrateCookieJar() method. Create file in old location, test that it moves to the new location, etc.
Btw, should migration overwrite new file in case where old file and new file presents?

@camilasan
Copy link
Member

Sorry I didn't reply before...

I can make test for tryMigrateCookieJar() method. Create file in old location, test that it moves to the new location, etc.

That makes sense.

Btw, should migration overwrite new file in case where old file and new file presents?

You should check if there is a file present before migrating. That is what we do with the config file nextcloud.cfg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants