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

Fix 'sync_list' handling of inclusions when name is included in another folders name #1390

Merged
merged 3 commits into from
Apr 8, 2021

Conversation

abraunegg
Copy link
Owner

@abraunegg abraunegg commented Apr 7, 2021

  • When a 'sync_list' entry contains /* the common path matching causes a sub path match to occur. Before directly hitting as an exact match, perform an additional check of the path to sync against the sync_list entry without the /* being present.

…er folders name

* When a 'sync_list' entry contains '/*' the common path matching causes a sub path match to occur. Before directly hitting as an exact match, perform an additional check of the path to sync against the sync_list entry without the '/*' being present.
@abraunegg
Copy link
Owner Author

Client Config:

Configuration file successfully loaded
onedrive version                       = v2.4.11-1-g97a468e
Config path                            = /home/alex/.config/onedrive-personal/
Config file found in config path       = true
Config option 'check_nosync'           = false
Config option 'sync_dir'               = /home/alex/OneDrivePersonal
Config option 'skip_dir'               = 
Config option 'skip_file'              = ~*|.~*|*.tmp
Config option 'skip_dotfiles'          = false
Config option 'skip_symlinks'          = false
Config option 'monitor_interval'       = 30
Config option 'min_notify_changes'     = 5
Config option 'log_dir'                = /var/log/onedrive/
Config option 'classify_as_big_delete' = 1000
Config option 'upload_only'            = false
Config option 'no_remote_delete'       = false
Config option 'remove_source_files'    = false
Config option 'sync_root_files'        = false
Selective sync 'sync_list' configured  = true
sync_list contents:
# Include
MyfolderSuper/*


Business Shared Folders configured     = false

Without PR:

Using 'user' Config Dir: /home/alex/.config/onedrive-personal/
Using 'system' Config Dir: 
Configuration file successfully loaded
Deleting the saved status ...
Initializing the OneDrive API ...
Configuring Global Azure AD Endpoints
Opening the item database ...
All operations will be performed in: /home/alex/OneDrivePersonal
Application version: v2.4.11-1-g97a468e
Account Type: personal
Default Drive ID: 66d53be8a5056eca
Default Root ID: 66D53BE8A5056ECA!101
Remaining Free Space: 5368703366
Fetching details for OneDrive Root
OneDrive Root does not exist in the database. We need to add it.
Added OneDrive Root to the local database
Initializing the Synchronization Engine ...
Syncing changes from OneDrive ...
Applying changes of Path ID: 66D53BE8A5056ECA!101
Updated Remaining Free Space: 5368703366
Processing 9 OneDrive items to ensure consistent local state due to sync_list being used
Creating local directory: Myfolder    <- BAD MATCH AND CREATE
Creating local directory: MyfolderSuper
Skipping item - excluded by sync_list config: Myfolder/myfile
Creating local directory: MyfolderSuper/MysubfolderSuper2
Creating local directory: MyfolderSuper/MysubfolderSuper1
Downloading file MyfolderSuper/MysubfolderSuper2/myfile2.txt ... done.
Downloading file MyfolderSuper/MysubfolderSuper1/myfile1.txt ... done.
Processing 1 OneDrive items to ensure consistent local state due to a full scan being triggered by actions on OneDrive
Uploading differences of ~/OneDrivePersonal
Processing .
The directory has not changed
Processing Myfolder
The directory has not changed
Processing MyfolderSuper
The directory has not changed
Processing MyfolderSuper/MysubfolderSuper2
The directory has not changed
Processing MyfolderSuper/MysubfolderSuper2/myfile2.txt
The file has not changed
Processing MyfolderSuper/MysubfolderSuper1
The directory has not changed
Processing MyfolderSuper/MysubfolderSuper1/myfile1.txt
The file has not changed
Uploading new items of ~/OneDrivePersonal
Applying changes of Path ID: 66D53BE8A5056ECA!101
Updated Remaining Free Space: 5368703366
Processing 1 OneDrive items to ensure consistent local state due to a full scan being requested

With PR:

Using 'user' Config Dir: /home/alex/.config/onedrive-personal/
Using 'system' Config Dir: 
Configuration file successfully loaded
Deleting the saved status ...
Initializing the OneDrive API ...
Configuring Global Azure AD Endpoints
Opening the item database ...
All operations will be performed in: /home/alex/OneDrivePersonal
Application version: v2.4.11-2-g1f658e4
Account Type: personal
Default Drive ID: 66d53be8a5056eca
Default Root ID: 66D53BE8A5056ECA!101
Remaining Free Space: 5368703366
Fetching details for OneDrive Root
OneDrive Root does not exist in the database. We need to add it.
Added OneDrive Root to the local database
Initializing the Synchronization Engine ...
Syncing changes from OneDrive ...
Applying changes of Path ID: 66D53BE8A5056ECA!101
Updated Remaining Free Space: 5368703366
Processing 9 OneDrive items to ensure consistent local state due to sync_list being used
Skipping item - excluded by sync_list config: Myfolder
Creating local directory: MyfolderSuper
Creating local directory: MyfolderSuper/MysubfolderSuper2
Creating local directory: MyfolderSuper/MysubfolderSuper1
Downloading file MyfolderSuper/MysubfolderSuper2/myfile2.txt ... done.
Downloading file MyfolderSuper/MysubfolderSuper1/myfile1.txt ... done.
Processing 1 OneDrive items to ensure consistent local state due to a full scan being triggered by actions on OneDrive
Uploading differences of ~/OneDrivePersonal
Processing .
The directory has not changed
Processing MyfolderSuper
The directory has not changed
Processing MyfolderSuper/MysubfolderSuper2
The directory has not changed
Processing MyfolderSuper/MysubfolderSuper2/myfile2.txt
The file has not changed
Processing MyfolderSuper/MysubfolderSuper1
The directory has not changed
Processing MyfolderSuper/MysubfolderSuper1/myfile1.txt
The file has not changed
Uploading new items of ~/OneDrivePersonal
Applying changes of Path ID: 66D53BE8A5056ECA!101
Updated Remaining Free Space: 5368703366
Processing 1 OneDrive items to ensure consistent local state due to a full scan being requested

@abraunegg abraunegg merged commit 3d59579 into master Apr 8, 2021
@abraunegg abraunegg deleted the fix-issue-1388 branch April 8, 2021 22:18
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators May 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sync_list: including folders it shouldn't when their name is included in another folder's name
2 participants