Skip to content

Ensure the default sync root is always saved - #1134

Merged
TheOneRing merged 2 commits into
mainfrom
work/save_default_sync
Oct 6, 2026
Merged

TheOneRing merged 2 commits into
mainfrom
work/save_default_sync

Conversation

@TheOneRing

Copy link
Copy Markdown
Contributor

Fixes: #1116

@TheOneRing
TheOneRing requested a review from dragotin September 29, 2026 11:57

@dragotin dragotin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we set this mark at all? Where do we really read them?


const QString dirTag()
{
return QStringLiteral("eu.opencloud.spaces.app");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: in other places we define these add const Strings. And: QStringLiterals

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just moved the code, there is nothing new here.

@TheOneRing TheOneRing Oct 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also one should not define QStrings in global statics as they are constructed at launch time which can slow down the overall startup. That's why a function is used here.
See https://github.com/opencloud-eu/desktop/security/code-scanning/465 for an example. https://github.com/KDE/clazy/blob/master/docs/checks/README-non-pod-global-static.md


const QString uuidTag()
{
return QStringLiteral("eu.opencloud.spaces.account-uuid");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dito

@TheOneRing

Copy link
Copy Markdown
Contributor Author

Why do we set this mark at all? Where do we really read them?

We set the mark to prevent us and branded clients from reusing an existing sync root. With the sync root, we can't rely on the existence of a .sync_journal.db which was previously used to see whether a folder was used by a sync folder.

The mark prevents the spaces of account A and account B to share a sync root, this intends to prevent accidental file copies to the WRONG Personal folder.

@TheOneRing
TheOneRing merged commit 97329f5 into main Oct 6, 2026
14 of 15 checks passed
@TheOneRing
TheOneRing deleted the work/save_default_sync branch October 6, 2026 14:37
@openclouders openclouders mentioned this pull request Nov 13, 2026
1 task
@saw-jan saw-jan mentioned this pull request Nov 25, 2026
9 of 22 tasks
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.

Unable to add a second space to the sync root after manual setup

2 participants