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

Improve Selective Sync #24

Open
manuth opened this issue Jan 22, 2020 · 2 comments
Open

Improve Selective Sync #24

manuth opened this issue Jan 22, 2020 · 2 comments

Comments

@manuth
Copy link

manuth commented Jan 22, 2020

General

The selective sync might become a very powerful but there are some troubles with it atm.
Currently it's not possible to sync the root using selective sync.

So let's say we have this tree:

Documents
├───Keys
├───School
└───Work

If I decide to sync the Documents folder and enable the Selective Sync I cannot sync the files inside the Documents folder as only Keys, Schook and Work can be selected when hitting Select folder(s).

Also excluding sub-nodes is not possible. If we assume we have this tree:

Personal Files
└─── [x] Documents
    ├─── [ ] Keys
    ├─── [x] School
    └─── [x] Work

If I decide to sync the "Personal Files" and I want to perform a selective sync of Documents, School and Work, but not Keys though I can deselect Keys in the Select folder(s) dialogue but it still would sync Keys because Documents is selected.

One more case that isn't covered using the current implementation of the selective sync:
Think of implementing some sort of "ExcludedRoots" it wouldn't be possible to include subnodes of them:

Personal Files
└─── [x] Documents
    ├─── [ ] Keys
    │       ├─── [x] KeePass
    │       └─── [ ] SSH
    ├─── [x] School
    └─── [x] Work

If I would want to exclude Keys but include the KeePass directory it wouldn't be possible as the parent node Keys is excluded already.

Conclusion and Examples

This leads me to following recommendation:

Rework the SelectireRoots-option of the config-schema to look the following:

"LeftURI": "https://[...]/Documents",
"SelectiveRoots": [
    { "Path": "/", "Include": true },
    { "Path": "/Keys", "Include": false },
    { "Path": "/Keys/KeePass", "Include": true }
]

The entries would then be processed by the order of their appearance, which means:

  1. "/" is included
  2. "/Keys" is excluded, but...
  3. ..."/Keys/KeePass" is included

Also I'd recommend to enable the checkboxes in the Select folder(s) dialogue to match the current config. That way the initial state of said dialoue would represent to current settings.

Another example:

"LeftURI": "https://[...]/Documents",
"SelectiveRoots": [
    { "Path": "/", "Include": true },
    { "Path": "/Keys/KeePass", "Include": true },
    { "Path": "/Keys", "Include": false }
]
  1. "/" is included
  2. "/Keys/KeePass" is included
  3. "/Keys" is excluded which causes "/Keys/KeePass" to be excluded as well
@manuth
Copy link
Author

manuth commented Jan 23, 2020

Another way the schema could be reworked would be some sort of an "Action"-field to set a single action or an array of actions.
This would allow to implement more actions yet to come for single folders:

"LeftURI": "https://[...]/Documents",
"SelectiveRoots": [
    { "Path": "/", "Action": "Include" },
    { "Path": "/Keys", "Action": "Ignore (or 'Exclude')" },
    { "Path": "/Keys/KeePass", "Action": "Include" }
]

@callmelex
Copy link

I also need this feature.
But I think an ignore list ( for folders & files ) is enough, keep it simple.

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

No branches or pull requests

3 participants